EXLA.Typespec (EXLA v0.11.0)

Copy Markdown View Source

Combined type and shape information about tensors.

In addition to the Nx types, also supports {:pred, 8} and :token, which are used internally within the compiler.

This struct corresponds to the xla::Shape class in the XLA compiler, but is also meant as a lightweight data structure for passing the information around.

Note: the name "typespec" has been chosen intentionally to distinguish it from both "type" and "shape".

Summary

Functions

Builds a tensor typespec.

Returns an updated typespec with the given shape.

Returns an updated typespec with the given type.

Builds a token typespec.

Functions

tensor(type, shape)

Builds a tensor typespec.

to_shape(typespec, shape)

Returns an updated typespec with the given shape.

to_type(typespec, type)

Returns an updated typespec with the given type.

token()

Builds a token typespec.