Module: tf.dtypes
Stay organized with collections
Save and categorize content based on your preferences.
Public API for tf._api.v2.dtypes namespace
Modules
experimental
module: Public API for tf._api.v2.dtypes.experimental namespace
Classes
class DType
: Represents the type of the elements in a Tensor
.
Functions
as_dtype(...)
: Converts the given type_value
to a tf.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
.
Other Members |
QUANTIZED_DTYPES
|
{
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
}
|
bfloat16
|
Instance of tf.dtypes.DType
16-bit bfloat (brain floating point).
|
bool
|
Instance of tf.dtypes.DType
Boolean.
|
complex128
|
Instance of tf.dtypes.DType
128-bit complex.
|
complex64
|
Instance of tf.dtypes.DType
64-bit complex.
|
double
|
Instance of tf.dtypes.DType
64-bit (double precision) floating-point.
|
float16
|
Instance of tf.dtypes.DType
16-bit (half precision) floating-point.
|
float32
|
Instance of tf.dtypes.DType
32-bit (single precision) floating-point.
|
float64
|
Instance of tf.dtypes.DType
64-bit (double precision) floating-point.
|
half
|
Instance of tf.dtypes.DType
16-bit (half precision) floating-point.
|
int16
|
Instance of tf.dtypes.DType
Signed 16-bit integer.
|
int32
|
Instance of tf.dtypes.DType
Signed 32-bit integer.
|
int64
|
Instance of tf.dtypes.DType
Signed 64-bit integer.
|
int8
|
Instance of tf.dtypes.DType
Signed 8-bit integer.
|
qint16
|
Instance of tf.dtypes.DType
Signed quantized 16-bit integer.
|
qint32
|
Instance of tf.dtypes.DType
signed quantized 32-bit integer.
|
qint8
|
Instance of tf.dtypes.DType
Signed quantized 8-bit integer.
|
quint16
|
Instance of tf.dtypes.DType
Unsigned quantized 16-bit integer.
|
quint8
|
Instance of tf.dtypes.DType
Unsigned quantized 8-bit integer.
|
resource
|
Instance of tf.dtypes.DType
Handle to a mutable, dynamically allocated resource.
|
string
|
Instance of tf.dtypes.DType
Variable-length string, represented as byte array.
|
uint16
|
Instance of tf.dtypes.DType
Unsigned 16-bit (word) integer.
|
uint32
|
Instance of tf.dtypes.DType
Unsigned 32-bit (dword) integer.
|
uint64
|
Instance of tf.dtypes.DType
Unsigned 64-bit (qword) integer.
|
uint8
|
Instance of tf.dtypes.DType
Unsigned 8-bit (byte) integer.
|
variant
|
Instance of tf.dtypes.DType
Data of arbitrary type (known at runtime).
|
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 2024-04-26 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 2024-04-26 UTC."],[],[],null,["# Module: tf.dtypes\n\n\u003cbr /\u003e\n\nPublic API for tf._api.v2.dtypes namespace\n\nModules\n-------\n\n[`experimental`](../tf/dtypes/experimental) module: Public API for tf._api.v2.dtypes.experimental 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 [`tf.DType`](../tf/dtypes/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) \u003cbr /\u003e 16-bit bfloat (brain floating point). |\n| bool | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e Boolean. |\n| complex128 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e 128-bit complex. |\n| complex64 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e 64-bit complex. |\n| double | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e 64-bit (double precision) floating-point. |\n| float16 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e 16-bit (half precision) floating-point. |\n| float32 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e 32-bit (single precision) floating-point. |\n| float64 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e 64-bit (double precision) floating-point. |\n| half | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e 16-bit (half precision) floating-point. |\n| int16 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e Signed 16-bit integer. |\n| int32 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e Signed 32-bit integer. |\n| int64 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e Signed 64-bit integer. |\n| int8 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e Signed 8-bit integer. |\n| qint16 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e Signed quantized 16-bit integer. |\n| qint32 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e signed quantized 32-bit integer. |\n| qint8 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e Signed quantized 8-bit integer. |\n| quint16 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e Unsigned quantized 16-bit integer. |\n| quint8 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e Unsigned quantized 8-bit integer. |\n| resource | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e Handle to a mutable, dynamically allocated resource. |\n| string | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e Variable-length string, represented as byte array. |\n| uint16 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e Unsigned 16-bit (word) integer. |\n| uint32 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e Unsigned 32-bit (dword) integer. |\n| uint64 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e Unsigned 64-bit (qword) integer. |\n| uint8 | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e Unsigned 8-bit (byte) integer. |\n| variant | Instance of [`tf.dtypes.DType`](../tf/dtypes/DType) \u003cbr /\u003e Data of arbitrary type (known at runtime). |\n\n\u003cbr /\u003e"]]