# `Monty.Attention.Merge`
[🔗](https://github.com/d-led/ex.tbp.monty/blob/v0.1.0/packages/ex_tbp_monty_core/lib/monty/attention/merge.ex#L1)

How two grids become one — Monty's `attention/merge.py`.

Attention can have more than one source of opinion in a step, and the merged
grid is what the goal filter then reads. Two grids can only be merged if they
share a scale: a voxel of one size cannot be unioned with a voxel of another,
because the result would not be a grid.

Monty names the merge operation `VoxelGridMerge` (a `Protocol`) and ships one
implementation, `Union`; the size check is a private function of this module.

# `check_can_merge!`

```elixir
@spec check_can_merge!(Monty.Attention.VoxelGrid.t(), Monty.Attention.VoxelGrid.t()) ::
  :ok
```

Refuse two grids that cannot be merged: different voxel sizes.

Different sizes would mean two grids that cannot agree on what a voxel is, so
the merge is refused by name rather than silently reinterpreted.

---

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