TFLiteElixir.LiteRT.Model (tflite_elixir v1.1.0)

Copy Markdown View Source

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.

Summary

Functions

Inspect subgraph connectivity and supported operator options.

Raising version of inspect/2.

Return a rewritten TFLite binary without modifying the source.

Types

edit()

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

source()

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

Functions

inspect(env, source)

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

Inspect subgraph connectivity and supported operator options.

inspect!(env, source)

Raising version of inspect/2.

rewrite(env, source, edits)

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

Return a rewritten TFLite binary without modifying the source.

rewrite!(env, source, edits)

Raising version of rewrite/3.