ExTorch.DType (extorch v0.2.0)

Copy Markdown

A torch.dtype is an object that represents the data type of a torch.Tensor. ExTorch has twelve different data types:

Summary

Types

Alias names to other integral/floating tensor types.

Basic tensor types

Complex number tensor types.

A torch.dtype is an object that represents the data type of a torch.Tensor.

Floating point tensor types.

Integral tensor types, unsigned and signed.

Numeric tensor types

Quantized floating point tensor types.

Types

alias_type()

@type alias_type() ::
  :byte
  | :char
  | :short
  | :int
  | :long
  | :half
  | :float
  | :double
  | :chalf
  | :cfloat
  | :cdouble
  | :complex_float
  | :complex_double

Alias names to other integral/floating tensor types.

base_type()

@type base_type() :: :bool | numeric_type() | complex_type()

Basic tensor types

complex_type()

@type complex_type() :: :complex32 | :complex64 | :complex128

Complex number tensor types.

dtype()

@type dtype() :: base_type() | complex_type() | quantized_type() | alias_type() | nil

A torch.dtype is an object that represents the data type of a torch.Tensor.

floating_type()

@type floating_type() :: :float16 | :bfloat16 | :float32 | :float64

Floating point tensor types.

integral_type()

@type integral_type() :: :uint8 | :int8 | :int16 | :int32 | :int64

Integral tensor types, unsigned and signed.

numeric_type()

@type numeric_type() :: integral_type() | floating_type()

Numeric tensor types

quantized_type()

@type quantized_type() :: :quint8 | :quint2x4 | :quint4x2 | :qint8 | :qint32

Quantized floating point tensor types.

Functions

is_dtype(dtype)

(macro)