Interpreter.fromAddress constructor
Interpreter.fromAddress(})
Creates interpreter from an address.
Typically used for passing interpreter between isolates.
allocated defaults to true because fromAddress is typically called
after tensors have already been allocated on the original interpreter.
This avoids redundant (and potentially thread-unsafe) allocateTensors()
calls when used across isolate boundaries.
Implementation
factory Interpreter.fromAddress(
int address, {
bool allocated = true,
bool deleted = false,
bool hasActiveDelegate = false,
}) {
final interpreter = Pointer<TfLiteInterpreter>.fromAddress(address);
return Interpreter._(
interpreter,
hasActiveDelegate: hasActiveDelegate,
skipAllocate: allocated,
)
.._deleted = deleted
.._allocated = allocated;
}