Attend the Women in ML Symposium on December 7 Register now


Stay organized with collections Save and categorize content based on your preferences.

Utility functions for dtypes.


as_numpy_dtype(...): Returns a np.dtype based on this dtype.

assert_same_float_dtype(...): Validate and return float type based on tensors and dtype.

base_dtype(...): Returns a non-reference dtype based on this dtype.

base_equal(...): Returns True if base dtypes are identical.

common_dtype(...): Returns (nested) explict dtype from args if there is one.

eps(...): Returns the distance between 1 and the next largest representable value.

is_bool(...): Returns whether this is a boolean data type.

is_complex(...): Returns whether this is a complex floating point type.

is_floating(...): Returns whether this is a (non-quantized, real) floating point type.

is_integer(...): Returns whether this is a (non-quantized) integer type.

is_numpy_compatible(...): Returns if dtype has a corresponding NumPy dtype.

max(...): Returns the maximum representable value in this data type.

min(...): Returns the minimum representable value in this data type.

name(...): Returns the string name for this dtype.

real_dtype(...): Returns the dtype of the real part.

size(...): Returns the number of bytes to represent this dtype.