# `Nx.Defn.Token`
[🔗](https://github.com/elixir-nx/nx/blob/v0.13.0/nx/lib/nx/defn/token.ex#L1)

A `defn` token used by hooks.

Deprecated. Use `hook/2` or `hook/3` instead. Will be removed in a future release.

## Documentation for compilers

The token has a `hooks` field as a list of maps of the shape:

    %{
      expr: Nx.Tensor.t | Nx.Container.t,
      name: atom(),
      callback: (Nx.Tensor.t | Nx.Container.t -> term()) | nil
    }

The `hooks` field must only be accessed by `defn` compilers.

---

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