1# format.h 2 3<!--Kit: MindSpore Lite Kit--> 4<!--Subsystem: AI--> 5<!--Owner: @zhuguodong8--> 6<!--Designer: @zhuguodong8; @jjfeing--> 7<!--Tester: @principal87--> 8<!--Adviser: @ge-yafang--> 9 10## Overview 11 12Declares tensor data formats. 13 14**File to include**: <mindspore/format.h> 15 16**Library**: libmindspore_lite_ndk.so 17 18**System capability**: SystemCapability.Ai.MindSpore 19 20**Since**: 9 21 22**Related module**: [MindSpore](capi-mindspore.md) 23 24## Summary 25 26### Enums 27 28| Name| typedef Keyword| Description| 29| -- | -- | -- | 30| [OH_AI_Format](#oh_ai_format) | OH_AI_Format | Data formats supported by MSTensor.| 31 32## Enum Description 33 34### OH_AI_Format 35 36``` 37enum OH_AI_Format 38``` 39 40**Description** 41 42Declares data formats supported by MSTensor. 43 44**Since**: 9 45 46| Enum Item| Description| 47| -- | -- | 48| OH_AI_FORMAT_NCHW = 0 | Tensor data is stored in the sequence of batch number N, channel C, height H, and width W.| 49| OH_AI_FORMAT_NHWC = 1 | Tensor data is stored in the sequence of batch number N, height H, width W, and channel C.| 50| OH_AI_FORMAT_NHWC4 = 2 | Tensor data is stored in the sequence of batch number N, height H, width W, and channel C. The C axis is 4-byte aligned.| 51| OH_AI_FORMAT_HWKC = 3 | Tensor data is stored in the sequence of height H, width W, core count K, and channel C.| 52| OH_AI_FORMAT_HWCK = 4 | Tensor data is stored in the sequence of height H, width W, channel C, and core count K.| 53| OH_AI_FORMAT_KCHW = 5 | Tensor data is stored in the sequence of core count K, channel C, height H, and width W.| 54| OH_AI_FORMAT_CKHW = 6 | Tensor data is stored in the sequence of channel C, core count K, height H, and width W.| 55| OH_AI_FORMAT_KHWC = 7 | Tensor data is stored in the sequence of core count K, height H, width W, and channel C.| 56| OH_AI_FORMAT_CHWK = 8 | Tensor data is stored in the sequence of channel C, height H, width W, and core count K.| 57| OH_AI_FORMAT_HW = 9 | Tensor data is stored in the sequence of height H and width W.| 58| OH_AI_FORMAT_HW4 = 10 | Tensor data is stored in the sequence of height H and width W. The W axis is 4-byte aligned.| 59| OH_AI_FORMAT_NC = 11 | Tensor data is stored in the sequence of batch number N and channel C.| 60| OH_AI_FORMAT_NC4 = 12 | Tensor data is stored in the sequence of batch number N and channel C. The C axis is 4-byte aligned.| 61| OH_AI_FORMAT_NC4HW4 = 13 | Tensor data is stored in the sequence of batch number N, channel C, height H, and width W. The C axis and W axis are 4-byte aligned.| 62| OH_AI_FORMAT_NCDHW = 15 | Tensor data is stored in the sequence of batch number N, channel C, depth D, height H, and width W.| 63| OH_AI_FORMAT_NWC = 16 | Tensor data is stored in the sequence of batch number N, width W, and channel C.| 64| OH_AI_FORMAT_NCW = 17 | Tensor data is stored in the sequence of batch number N, channel C, and width W.| 65