# `TFLiteElixir.LiteRT.Model`
[🔗](https://github.com/cocoa-xu/tflite_elixir/blob/main/lib/tflite_elixir/litert/model.ex#L1)

Experimental LiteRT graph inspection and operator option rewrites.

`inspect/2` reports subgraph connectivity and supported OneHot, SplitV and
StableHLO composite options. Other operators retain their numeric opcode.
`rewrite/3` returns a new TFLite binary and preserves the source, tensor shapes
and connectivity. Callers must keep edited options consistent with those
shapes. This uses LiteRT's experimental builder API and requires a newer
upstream dependency; older versions return an error.

# `edit`

```elixir
@type edit() :: %{
  subgraph: non_neg_integer(),
  operator: non_neg_integer(),
  options: map()
}
```

# `source`

```elixir
@type source() :: String.t() | {:buffer, binary()}
```

# `inspect`

```elixir
@spec inspect(reference(), source()) :: {:ok, [map()]} | {:error, String.t()}
```

Inspect subgraph connectivity and supported operator options.

# `inspect!`

Raising version of `inspect/2`.

# `rewrite`

```elixir
@spec rewrite(reference(), source(), [edit()]) ::
  {:ok, binary()} | {:error, String.t()}
```

Return a rewritten TFLite binary without modifying the source.

# `rewrite!`

Raising version of `rewrite/3`.

---

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