# `ExBurn`
[🔗](https://github.com/ohhi-vn/ex_burn/blob/main/lib/ex_burn.ex#L1)

ExBurn — Elixir bridge to the [Burn](https://burn.dev) deep learning framework.

ExBurn provides a high-level API for tensor computation, neural network
training, and GPU-accelerated machine learning by delegating to Burn
via Rust NIFs (Native Implemented Functions).

## Architecture

```
Elixir/Axon → Nx.Defn → ExBurn.Backend → ExBurn.Nif (Rustler) → Burn/CubeCL → GPU
                                                                  ↕
                                                            ExCubecl (GPU buffers, kernels, pipelines)
```

## Quick Start

    # Set ExBurn as the default Nx backend
    Nx.default_backend(ExBurn.Backend)

    # Create and manipulate tensors
    t = Nx.tensor([1.0, 2.0, 3.0])
    Nx.add(t, t) |> Nx.to_list()

## Modules

- `ExBurn.Backend` — Nx backend that delegates to Burn via NIF
- `ExBurn.Nif`     — Rustler NIF stubs for Burn interop
- `ExBurn.Tensor`  — Tensor conversion utilities between Nx and Burn formats
- `ExBurn.BurnBridge` — High-level bridge for Burn operations and ExCubecl buffers
- `ExBurn.CubeclBridge` — GPU compute via ExCubecl (buffers, kernels, pipelines)
- `ExBurn.Model`   — Model definition and training orchestration
- `ExBurn.Training` — Training loop implementation
- `ExBurn.Serving` — Nx.Serving integration for batched concurrent inference

# `configure!`

```elixir
@spec configure!() :: :ok
```

Sets the default Nx backend to `ExBurn.Backend`.

After calling this, all Nx operations will be executed via Burn.

# `default_device`

```elixir
@spec default_device() :: :cpu | :gpu
```

Returns the default device for tensor operations.

Currently returns `:gpu` when a compatible GPU backend is available,
otherwise falls back to `:cpu`.

# `version`

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

Returns the current version of ExBurn.

---

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