# `BB.Inference.Description.Tensor`
[🔗](https://github.com/beam-bots/bb_inference/blob/main/lib/bb/inference/description/tensor.ex#L5)

One input or output of a model.

- `name` - what the model calls it; the key in `run/2`'s maps
- `shape` - a tuple of dimensions, any of which may be `nil` where the model
  leaves it dynamic; `nil` if the runtime can't report a shape at all
- `type` - the `Nx.Type` the runtime takes or gives, which for a quantised
  tensor is the raw integer type
- `layout` - `:nchw`, `:nhwc` or another layout the runtime reports, or
  `nil` when it doesn't know
- `quantisation` - how the raw values map to real ones, or `nil` if the
  tensor isn't quantised or the runtime can't say

# `dimension`

```elixir
@type dimension() :: non_neg_integer() | nil
```

# `t`

```elixir
@type t() :: %BB.Inference.Description.Tensor{
  layout: atom() | nil,
  name: String.t(),
  quantisation: BB.Inference.Quantisation.t() | nil,
  shape: tuple() | nil,
  type: Nx.Type.t() | nil
}
```

# `summary`

```elixir
@spec summary(t()) :: String.t()
```

A short summary for error messages: `images {1, 3, 416, 416} f32`.

---

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