ExTorch.Scalar (extorch v0.4.0)

Copy Markdown

An ExTorch.Scalar is any singular value that can be stored in a ExTorch.Tensor.

Summary

Types

An scalar list is a list that either contains scalars or scalar lists.

Scalar or scalar list type specifier.

t()

A scalar consists of any value that can be stored in an ExTorch.Tensor struct.

Types

scalar_list()

@type scalar_list() :: [t() | [scalar_list()]]

An scalar list is a list that either contains scalars or scalar lists.

scalar_or_list()

@type scalar_or_list() :: t() | scalar_list() | tuple()

Scalar or scalar list type specifier.

t()

@type t() :: number() | :nan | :inf | :ninf | ExTorch.Complex.t()

A scalar consists of any value that can be stored in an ExTorch.Tensor struct.

It can be:

  • Any number, floating or integer.
  • The special floating point values :nan, :inf and :ninf, which represent the Not-A-Number, positive infinity and negative infinity, respectively.
  • A complex value represented by the ExTorch.Complex struct.

Functions

is_scalar(x)

(macro)