View Source TFLiteElixir.InterpreterBuilder (tflite_elixir v1.0.0-rc4)
Build an interpreter capable of interpreting model.
Summary
Functions
Attach a delegate to the builder, with the default decline policy.
Attach a delegate to every interpreter this builder goes on to build.
Raising version of add_delegate/2.
Raising version of add_delegate/3.
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.
Raising version of set_num_threads/2.
Types
Functions
Attach a delegate to the builder, with the default decline policy.
Equivalent to add_delegate(builder, delegate, []).
Attach a delegate to every interpreter this builder goes on to build.
The delegate is applied in the order delegates were added, and it has to outlive every interpreter built from this builder -- which is why there is no way to detach or delete one. Holding the reference is not required: the builder and each interpreter keep the delegate alive for as long as they need it.
Attaching any delegate also suppresses the XNNPACK one that build/2 would
otherwise add for you.
Options
:on_decline. What to do when a delegate reports that it cannot take the graph, but leaves the graph runnable -- a static-shape delegate meeting a dynamic tensor, say. TfLite discards the whole interpreter in that case.
Note that an interpreter, and any delegate attached to it, belongs to one process at a time. Nothing here is serialised for you.
Raising version of add_delegate/2.
Raising version of add_delegate/3.
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.
Raising version of build/2.
@spec new( %TFLiteElixir.FlatBufferModel{ initialized: term(), minimum_runtime: term(), model: term() }, reference() ) :: nif_resource_ok() | nif_error()
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.
Raising version of set_num_threads/2.