# Module: tf.dtypes

<br />

Public API for tf._api.v2.dtypes namespace

## Modules

[`experimental`](https://www.tensorflow.org/api_docs/python/tf/dtypes/experimental) module: Public API for tf._api.v2.dtypes.experimental namespace

## Classes

[`class DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType): Represents the type of the elements in a `Tensor`.

## Functions

[`as_dtype(...)`](https://www.tensorflow.org/api_docs/python/tf/dtypes/as_dtype): Converts the given `type_value` to a [`tf.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType).

[`cast(...)`](https://www.tensorflow.org/api_docs/python/tf/cast): Casts a tensor to a new type.

[`complex(...)`](https://www.tensorflow.org/api_docs/python/tf/dtypes/complex): Converts two real numbers to a complex number.

[`saturate_cast(...)`](https://www.tensorflow.org/api_docs/python/tf/dtypes/saturate_cast): Performs a safe saturating cast of `value` to `dtype`.

<br />

<br />

<br />

| ## Other Members ||
|---|---|
| QUANTIZED_DTYPES | <br /> { tf.qint16, tf.qint16_ref, tf.qint32, tf.qint32_ref, tf.qint8, tf.qint8_ref, tf.quint16, tf.quint16_ref, tf.quint8, tf.quint8_ref } <br /> |
| bfloat16 | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> 16-bit bfloat (brain floating point). |
| bool | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> Boolean. |
| complex128 | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> 128-bit complex. |
| complex64 | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> 64-bit complex. |
| double | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> 64-bit (double precision) floating-point. |
| float16 | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> 16-bit (half precision) floating-point. |
| float32 | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> 32-bit (single precision) floating-point. |
| float64 | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> 64-bit (double precision) floating-point. |
| half | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> 16-bit (half precision) floating-point. |
| int16 | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> Signed 16-bit integer. |
| int32 | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> Signed 32-bit integer. |
| int64 | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> Signed 64-bit integer. |
| int8 | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> Signed 8-bit integer. |
| qint16 | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> Signed quantized 16-bit integer. |
| qint32 | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> signed quantized 32-bit integer. |
| qint8 | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> Signed quantized 8-bit integer. |
| quint16 | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> Unsigned quantized 16-bit integer. |
| quint8 | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> Unsigned quantized 8-bit integer. |
| resource | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> Handle to a mutable, dynamically allocated resource. |
| string | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> Variable-length string, represented as byte array. |
| uint16 | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> Unsigned 16-bit (word) integer. |
| uint32 | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> Unsigned 32-bit (dword) integer. |
| uint64 | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> Unsigned 64-bit (qword) integer. |
| uint8 | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> Unsigned 8-bit (byte) integer. |
| variant | Instance of [`tf.dtypes.DType`](https://www.tensorflow.org/api_docs/python/tf/dtypes/DType) <br /> Data of arbitrary type (known at runtime). |

<br />