![]() |
Converts the given type_value
to a DType
.
Aliases:
tf.as_dtype
tf.compat.v1.as_dtype
tf.compat.v1.dtypes.as_dtype
tf.compat.v2.as_dtype
tf.compat.v2.dtypes.as_dtype
tf.dtypes.as_dtype(type_value)
Args:
type_value
: A value that can be converted to atf.DType
object. This may currently be atf.DType
object, aDataType
enum, a string type name, or anumpy.dtype
.
Returns:
A DType
corresponding to type_value
.
Raises:
TypeError
: Iftype_value
cannot be converted to aDType
.