# `Einops.Error`
[🔗](https://github.com/woncoh1/einops-nx/blob/v0.1.0/lib/einops/error.ex#L1)

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.

# `t`

```elixir
@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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
