ExTorch.DType (extorch v0.1.0-pre0)

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

Link to this section 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.

Link to this section Types

Link to this type

alias_type()

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

Alias names to other integral/floating tensor types.

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

Basic tensor types

Link to this type

complex_type()

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

Complex number tensor types.

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

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

Link to this type

floating_type()

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

Floating point tensor types.

Link to this type

integral_type()

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

Integral tensor types, unsigned and signed.

Link to this type

numeric_type()

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

Numeric tensor types

Link to this type

quantized_type()

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

Quantized floating point tensor types.

Link to this section Functions

Link to this macro

is_dtype(dtype)

(macro)