Einops.Error exception (Einops v0.1.0)

Copy Markdown View Source

A pattern, shape, or argument error raised by an Einops operation.

The exception retains the original call in these fields:

  • operation — :rearrange, :reduce, :repeat, or :parse_shape.
  • pattern — the supplied pattern, including an invalid non-string value.
  • shape — the tensor's ordinary shape, or :unknown for a non-tensor input.
  • axes — the supplied length arguments; [] for Einops.parse_shape/2.
  • reason — a description of the validation failure.

message combines the reason and call context for display. Axis indexes in diagnostics are zero-based. Validation runs eagerly for ordinary calls and during tracing for Nx.Defn calls.

Summary

Types

t()

The validation failure and the original arguments that produced it.

Types

t()

@type t() :: %Einops.Error{
  __exception__: term(),
  axes: term(),
  message: String.t(),
  operation: :rearrange | :reduce | :repeat | :parse_shape,
  pattern: term(),
  reason: String.t(),
  shape: tuple() | :unknown
}

The validation failure and the original arguments that produced it.