Packages

Convert neural network weights to balanced ternary and run them at runtime.

Current section

Files

Jump to
balanced_ternary_engine guides runtime.md
Raw

guides/runtime.md

# Runtime Guide

```elixir
{:ok, rt} = BalancedTernaryEngine.Runtime.load("model.tbin", %{})
out = BalancedTernaryEngine.Runtime.forward(rt, input)
{out, rt} = BalancedTernaryEngine.Runtime.prefill(rt, input)
{out, rt} = BalancedTernaryEngine.Runtime.decode(rt, input)
```

Reset the cache with `BalancedTernaryEngine.Runtime.reset_cache/1`.