DType¶
- class
dragon.vm.tensorflow.dtypes.DType(value)[source]¶ The basic data type.
Following data types are defined:
tf.float16: 16-bit half-precision floating-point.tf.float32: 32-bit single-precision floating-point.tf.float64: 64-bit double-precision floating-point.tf.bfloat16: 16-bit truncated floating-point.tf.complex64: 64-bit single-precision complex.tf.complex128: 128-bit double-precision complex.tf.int8: 8-bit signed integer.tf.uint8: 8-bit unsigned integer.tf.uint16: 16-bit unsigned integer.tf.uint32: 32-bit unsigned integer.tf.uint64: 64-bit unsigned integer.tf.int16: 16-bit signed integer.tf.int32: 32-bit signed integer.tf.int64: 64-bit signed integer.tf.bool: Boolean.tf.string: String.tf.qint8: Quantized 8-bit signed integer.tf.quint8: Quantized 8-bit unsigned integer.tf.qint16: Quantized 16-bit signed integer.tf.quint16: Quantized 16-bit unsigned integer.tf.qint32: Quantized 32-bit signed integer.tf.variant: Values of arbitrary types.
Properties¶
as_numpy_dtype¶
DType.as_numpy_dtype¶Return as the number of numpy data type.
- Returns:
- type – The data type number.
as_datatype_enum¶
DType.as_datatype_enum¶Return as the enum value of data type.
- Returns:
- int – The enum value.
base_dtype¶
DType.base_dtype¶Return the non-referenced data type.
- Returns:
- dragon.vm.tensorflow.dtypes.DType – The data type.
is_numpy_compatible¶
DType.is_numpy_compatible¶Return whether this data type is compatible with numpy.
- Returns:
- bool –
Trueif compatible otherwiseFalse.
is_bool¶
DType.is_bool¶Return whether this is a boolean type.
- Returns:
- bool –
Trueif this is a boolean type otherwiseFalse.
is_complex¶
DType.is_complex¶Return whether this is a complex type.
- Returns:
- bool –
Trueif this is a complex type otherwiseFalse.
is_floating¶
DType.is_floating¶Return whether this is a floating type.
- Returns:
- bool –
Trueif this is a floating type otherwiseFalse.
is_integer¶
DType.is_integer¶Return whether this is a integer type.
- Returns:
- bool –
Trueif this is a integer type otherwiseFalse.
is_quantized¶
DType.is_quantized¶Return whether this is a quantized type.
- Returns:
- bool –
Trueif this is a quantized type otherwiseFalse.
is_unsigned¶
DType.is_unsigned¶Return whether this is an unsigned type.
- Returns:
- bool –
Trueif this is an unsigned type otherwiseFalse.