Python module
dtype
DType
β
class max.dtype.DType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
The tensor data type.
bfloat16
β
bfloat16 = 12
bool
β
bool = 0
float16
β
float16 = 9
float32
β
float32 = 10
float64
β
float64 = 11
from_numpy()
β
Converts a NumPy dtype to the corresponding DType.
-
Parameters:
dtype (np.dtype) β The NumPy dtype to convert.
-
Returns:
The corresponding DType enum value.
-
Return type:
-
Raises:
ValueError β If the input dtype is not supported.
int16
β
int16 = 2
int32
β
int32 = 3
int64
β
int64 = 4
int8
β
int8 = 1
to_numpy()
β
to_numpy() β dtype
Converts a NumPy dtype to the corresponding DType.
-
Parameters:
dtype (np.dtype) β The NumPy dtype to convert.
-
Returns:
The corresponding DType enum value.
-
Return type:
-
Raises:
ValueError β If the input dtype is not supported.
uint16
β
uint16 = 6
uint32
β
uint32 = 7
uint64
β
uint64 = 8
uint8
β
uint8 = 5
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
If you'd like to share more information, please report an issue on GitHub
π What went wrong?