torchoutil.core.dtype_enum module

class DTypeEnum(
value,
)[source]

Bases: StrEnum

Enum of torch dtypes.

bfloat16 = 'bfloat16'
bool = 'bool'
cdouble = 'complex128'
cfloat = 'complex64'
chalf = 'complex32'
complex128 = 'complex128'
complex32 = 'complex32'
complex64 = 'complex64'
classmethod default() DTypeEnum[source]
double = 'float64'
property dtype: dtype
float = 'float32'
float16 = 'float16'
float32 = 'float32'
float64 = 'float64'
classmethod from_dtype(
dtype: dtype,
) DTypeEnum[source]
half = 'float16'
int = 'int32'
int16 = 'int16'
int32 = 'int32'
int64 = 'int64'
int8 = 'int8'
property is_complex: bool
property is_floating_point: bool
property is_signed: bool
property itemsize: int
long = 'int64'
qint32 = 'qint32'
qint8 = 'qint8'
quint2x4 = 'quint2x4'
quint4x2 = 'quint4x2'
quint8 = 'quint8'
short = 'int16'
to_complex() DTypeEnum[source]
to_real() DTypeEnum[source]
uint16 = 'uint16'
uint32 = 'uint32'
uint64 = 'uint64'
uint8 = 'uint8'
enum_dtype_to_str(
dtype: DTypeEnum,
) str[source]
enum_dtype_to_torch_dtype(
dtype: DTypeEnum,
) dtype[source]
str_to_enum_dtype(
dtype: str,
) DTypeEnum[source]
str_to_torch_dtype(
dtype: str,
) dtype[source]
torch_dtype_to_enum_dtype(
dtype: dtype,
) DTypeEnum[source]
torch_dtype_to_str(
dtype: dtype,
) str[source]