| View source on GitHub | 
Converts the given type_value to a DType.
tf.dtypes.as_dtype(
    type_value
)
  Note:DTypevalues are interned. When passed a newDTypeobject,as_dtypealways returns the interned value.
| Args | |
|---|---|
| type_value | A value that can be converted to a tf.DTypeobject. This may currently be atf.DTypeobject, aDataTypeenum, a string type name, or anumpy.dtype. | 
| Returns | |
|---|---|
| A DTypecorresponding totype_value. | 
| Raises | |
|---|---|
| TypeError | If type_valuecannot be converted to aDType. | 
    © 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
    https://www.tensorflow.org/versions/r2.9/api_docs/python/tf/dtypes/as_dtype