Type
DataType enum
DataType identifies the element type of an NDArray at runtime. It is stored in the dtype property of every array.
Values
Constant | nativeCode | itemSize | Kotlin class |
|---|---|---|---|
| 1 | 1 |
|
| 2 | 2 |
|
| 3 | 4 |
|
| 4 | 8 |
|
| 5 | 4 |
|
| 6 | 8 |
|
| 7 | 8 |
|
| 8 | 16 |
|
Properties
Property | Type | Description |
|---|---|---|
|
| Integer identifier used by the JNI layer (1–8). |
|
| Bytes per element. |
|
| Corresponding Kotlin class. |
Instance methods
isNumber
Returns true for types 1–6 (non-complex numeric types).
isComplex
Returns true for ComplexFloatDataType and ComplexDoubleDataType.
Companion methods
of (by native code)
Returns the DataType matching the given nativeCode. Throws if i is out of range.
of (by element)
Infers the DataType from an element instance.
ofKClass
Resolves a DataType from a KClass.