View Source TFLiteElixir.InterpreterBuilder (tflite_elixir v0.3.7)

Build an interpreter capable of interpreting model.

Summary

Functions

Build the interpreter with the InterpreterBuilder.

Raising version of build/2.

New InterpreterBuilder

Raising version of new/2.

Sets the number of CPU threads to use for the interpreter. Returns true on success, {:error, reason} on error.

Types

@type nif_error() :: {:error, String.t()}
@type nif_resource_ok() :: {:ok, reference()}

Functions

Link to this function

build(self, interpreter)

View Source
@spec build(reference(), reference()) :: :ok | nif_error()

Build the interpreter with the InterpreterBuilder.

Note: all Interpreters should be built with the InterpreterBuilder, which allocates memory for the Interpreter and does various set up tasks so that the Interpreter can read the provided model.

Link to this function

build!(self, interpreter)

View Source

Raising version of build/2.

Link to this function

new(flat_buffer_model, resolver)

View Source
@spec new(
  %TFLiteElixir.FlatBufferModel{
    initialized: term(),
    minimum_runtime: term(),
    model: term()
  },
  reference()
) :: nif_resource_ok() | nif_error()

New InterpreterBuilder

Raising version of new/2.

Link to this function

set_num_threads(self, num_threads)

View Source
@spec set_num_threads(reference(), integer()) :: :ok | nif_error()

Sets the number of CPU threads to use for the interpreter. Returns true on success, {:error, reason} on error.

Link to this function

set_num_threads!(self, num_threads)

View Source

Raising version of set_num_threads/2.