|
10 | 10 |
|
11 | 11 | NS_ASSUME_NONNULL_BEGIN
|
12 | 12 |
|
| 13 | +/** |
| 14 | + * Enum to define the data type of a Tensor. |
| 15 | + * Values can be a subset, but must numerically match exactly those defined in |
| 16 | + * runtime/core/portable_type/scalar_type.h |
| 17 | + */ |
| 18 | +typedef NS_ENUM(int8_t, ExecuTorchDataType) { |
| 19 | + ExecuTorchDataTypeByte, |
| 20 | + ExecuTorchDataTypeChar, |
| 21 | + ExecuTorchDataTypeShort, |
| 22 | + ExecuTorchDataTypeInt, |
| 23 | + ExecuTorchDataTypeLong, |
| 24 | + ExecuTorchDataTypeHalf, |
| 25 | + ExecuTorchDataTypeFloat, |
| 26 | + ExecuTorchDataTypeDouble, |
| 27 | + ExecuTorchDataTypeComplexHalf, |
| 28 | + ExecuTorchDataTypeComplexFloat, |
| 29 | + ExecuTorchDataTypeComplexDouble, |
| 30 | + ExecuTorchDataTypeBool, |
| 31 | + ExecuTorchDataTypeQInt8, |
| 32 | + ExecuTorchDataTypeQUInt8, |
| 33 | + ExecuTorchDataTypeQInt32, |
| 34 | + ExecuTorchDataTypeBFloat16, |
| 35 | + ExecuTorchDataTypeQUInt4x2, |
| 36 | + ExecuTorchDataTypeQUInt2x4, |
| 37 | + ExecuTorchDataTypeBits1x8, |
| 38 | + ExecuTorchDataTypeBits2x4, |
| 39 | + ExecuTorchDataTypeBits4x2, |
| 40 | + ExecuTorchDataTypeBits8, |
| 41 | + ExecuTorchDataTypeBits16, |
| 42 | + ExecuTorchDataTypeFloat8_e5m2, |
| 43 | + ExecuTorchDataTypeFloat8_e4m3fn, |
| 44 | + ExecuTorchDataTypeFloat8_e5m2fnuz, |
| 45 | + ExecuTorchDataTypeFloat8_e4m3fnuz, |
| 46 | + ExecuTorchDataTypeUInt16, |
| 47 | + ExecuTorchDataTypeUInt32, |
| 48 | + ExecuTorchDataTypeUInt64, |
| 49 | + ExecuTorchDataTypeUndefined, |
| 50 | + ExecuTorchDataTypeNumOptions, |
| 51 | +} NS_SWIFT_NAME(DataType); |
| 52 | + |
| 53 | +/** |
| 54 | + * Enum to define the shape dynamism of a Tensor. |
| 55 | + * Values can be a subset, but must numerically match exactly those defined in |
| 56 | + * runtime/core/tensor_shape_dynamism.h |
| 57 | + */ |
| 58 | +typedef NS_ENUM(uint8_t, ExecuTorchShapeDynamism) { |
| 59 | + ExecuTorchShapeDynamismStatic, |
| 60 | + ExecuTorchShapeDynamismDynamicBound, |
| 61 | + ExecuTorchShapeDynamismDynamicUnbound, |
| 62 | +} NS_SWIFT_NAME(ShapeDynamism); |
| 63 | + |
13 | 64 | NS_SWIFT_NAME(Tensor)
|
14 | 65 | __attribute__((deprecated("This API is experimental.")))
|
15 | 66 | @interface ExecuTorchTensor : NSObject
|
|
0 commit comments