# `Tinkex.ByteEstimator`
[🔗](https://github.com/North-Shore-AI/tinkex/blob/v0.4.0/lib/tinkex/byte_estimator.ex#L1)

Byte size estimation for model inputs and datums.

Provides consistent heuristics across training chunking and sampling dispatch:
- Image chunks: raw byte size of the data string
- Image asset pointers: byte size of the location string
- Encoded text and other length-aware chunks: token count * 10 bytes
- Loss function inputs (TensorData / tensors / plain maps): element count * 10 bytes

# `estimate_chunk_bytes`

```elixir
@spec estimate_chunk_bytes(struct()) :: non_neg_integer()
```

Estimate byte size of a single `ModelInput` chunk.

# `estimate_data_bytes`

```elixir
@spec estimate_data_bytes([Tinkex.Types.Datum.t()]) :: non_neg_integer()
```

Estimate byte size for a list of datums.

# `estimate_datum_bytes`

```elixir
@spec estimate_datum_bytes(Tinkex.Types.Datum.t() | map()) :: non_neg_integer()
```

Estimate byte size of a `Datum`.

# `estimate_loss_fn_inputs_bytes`

```elixir
@spec estimate_loss_fn_inputs_bytes(map() | any()) :: non_neg_integer()
```

Estimate byte size of loss function inputs map.

# `estimate_model_input_bytes`

```elixir
@spec estimate_model_input_bytes(Tinkex.Types.ModelInput.t() | any()) ::
  non_neg_integer()
```

Estimate byte size of a `ModelInput`.

---

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