# Module: tf.dtypes

<br />

|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 1 version](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/dtypes) |

Public API for tf.dtypes namespace.

## Classes

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

## Functions

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

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

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

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

## Other Members

- `QUANTIZED_DTYPES`
- `bfloat16`
- `bool`
- `complex128`
- `complex64`
- `double`
- `float16`
- `float32`
- `float64`
- `half`
- `int16`
- `int32`
- `int64`
- `int8`
- `qint16`
- `qint32`
- `qint8`
- `quint16`
- `quint8`
- `resource`
- `string`
- `uint16`
- `uint32`
- `uint64`
- `uint8`
- `variant`