Module: tf.dtypes
Stay organized with collections
Save and categorize content based on your preferences.
Public API for tf.dtypes namespace.
Classes
class DType
: Represents the type of the elements in a Tensor
.
Functions
as_dtype(...)
: Converts the given type_value
to a DType
.
cast(...)
: Casts a tensor to a new type.
complex(...)
: Converts two real numbers to a complex number.
saturate_cast(...)
: Performs a safe saturating cast of value
to dtype
.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2021-05-14 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2021-05-14 UTC."],[],[],null,["# Module: tf.dtypes\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------|\n| [TensorFlow 1 version](/versions/r1.15/api_docs/python/tf/dtypes) |\n\nPublic API for tf.dtypes namespace.\n\nClasses\n-------\n\n[`class DType`](../tf/dtypes/DType): Represents the type of the elements in a `Tensor`.\n\nFunctions\n---------\n\n[`as_dtype(...)`](../tf/dtypes/as_dtype): Converts the given `type_value` to a `DType`.\n\n[`cast(...)`](../tf/cast): Casts a tensor to a new type.\n\n[`complex(...)`](../tf/dtypes/complex): Converts two real numbers to a complex number.\n\n[`saturate_cast(...)`](../tf/dtypes/saturate_cast): Performs a safe saturating cast of `value` to `dtype`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Other Members ------------- ||\n|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|\n| QUANTIZED_DTYPES | \u003cbr /\u003e { 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 } \u003cbr /\u003e |\n| bfloat16 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| bool | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| complex128 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| complex64 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| double | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| float16 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| float32 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| float64 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| half | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| int16 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| int32 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| int64 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| int8 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| qint16 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| qint32 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| qint8 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| quint16 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| quint8 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| resource | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| string | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| uint16 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| uint32 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| uint64 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| uint8 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n| variant | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) |\n\n\u003cbr /\u003e"]]