@Namespace(value="tflite::impl") @NoOffset @Properties(inherit=tensorflowlite.class) public class Interpreter extends Pointer
Modifier and Type | Class and Description |
---|---|
static class |
Interpreter.Check_cancelled_func_Pointer
\warning This is an experimental API and subject to change.
|
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Modifier and Type | Field and Description |
---|---|
static int |
kTensorsCapacityHeadroom |
static int |
kTensorsReservedCapacity |
Constructor and Description |
---|
Interpreter() |
Interpreter(ErrorReporter error_reporter) |
Interpreter(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
AddNodeWithParameters(int[] inputs,
int[] outputs,
BytePointer init_data,
long init_data_size,
Pointer builtin_data,
TfLiteRegistration registration) |
int |
AddNodeWithParameters(int[] inputs,
int[] outputs,
BytePointer init_data,
long init_data_size,
Pointer builtin_data,
TfLiteRegistration registration,
int[] node_index) |
int |
AddNodeWithParameters(int[] inputs,
int[] outputs,
String init_data,
long init_data_size,
Pointer builtin_data,
TfLiteRegistration registration) |
int |
AddNodeWithParameters(int[] inputs,
int[] outputs,
String init_data,
long init_data_size,
Pointer builtin_data,
TfLiteRegistration registration,
int[] node_index) |
int |
AddNodeWithParameters(IntBuffer inputs,
IntBuffer outputs,
BytePointer init_data,
long init_data_size,
Pointer builtin_data,
TfLiteRegistration registration) |
int |
AddNodeWithParameters(IntBuffer inputs,
IntBuffer outputs,
BytePointer init_data,
long init_data_size,
Pointer builtin_data,
TfLiteRegistration registration,
IntBuffer node_index) |
int |
AddNodeWithParameters(IntBuffer inputs,
IntBuffer outputs,
String init_data,
long init_data_size,
Pointer builtin_data,
TfLiteRegistration registration) |
int |
AddNodeWithParameters(IntBuffer inputs,
IntBuffer outputs,
String init_data,
long init_data_size,
Pointer builtin_data,
TfLiteRegistration registration,
IntBuffer node_index) |
int |
AddNodeWithParameters(IntPointer inputs,
IntPointer outputs,
BytePointer init_data,
long init_data_size,
Pointer builtin_data,
TfLiteRegistration registration) |
int |
AddNodeWithParameters(IntPointer inputs,
IntPointer outputs,
BytePointer init_data,
long init_data_size,
Pointer builtin_data,
TfLiteRegistration registration,
IntPointer node_index)
Adds a node with the given parameters and returns the index of the new
node in
node_index (optionally). |
int |
AddNodeWithParameters(IntPointer inputs,
IntPointer outputs,
String init_data,
long init_data_size,
Pointer builtin_data,
TfLiteRegistration registration) |
int |
AddNodeWithParameters(IntPointer inputs,
IntPointer outputs,
String init_data,
long init_data_size,
Pointer builtin_data,
TfLiteRegistration registration,
IntPointer node_index) |
void |
AddProfiler(Profiler profiler)
\warning This is an experimental API and subject to change.
|
int |
AddTensors(int tensors_to_add) |
int |
AddTensors(int tensors_to_add,
int[] first_new_tensor_index) |
int |
AddTensors(int tensors_to_add,
IntBuffer first_new_tensor_index) |
int |
AddTensors(int tensors_to_add,
IntPointer first_new_tensor_index)
Adds
tensors_to_add tensors, preserving pre-existing Tensor entries. |
int |
AllocateTensors()
Update allocations for all tensors.
|
int |
ApplyOptions(InterpreterOptions options)
\warning This is an experimental API and subject to change.
|
int |
Cancel()
\warning This is an experimental API and subject to change.
|
int |
EnableCancellation()
Enables application to cancel in flight invocation with
Cancel . |
int |
EnsureTensorDataIsReadable(int tensor_index)
\warning This is an experimental API and subject to change.
|
ErrorReporter |
error_reporter()
\warning Experimental interface, subject to change.
|
IntPointer |
execution_plan()
\warning Experimental interface, subject to change.
|
boolean |
GetAllowFp16PrecisionForFp32()
\warning Experimental interface, subject to change.
|
int |
GetBufferHandle(int tensor_index,
int[] buffer_handle,
TfLiteDelegate delegate) |
int |
GetBufferHandle(int tensor_index,
IntBuffer buffer_handle,
TfLiteDelegate delegate) |
int |
GetBufferHandle(int tensor_index,
IntPointer buffer_handle,
PointerPointer delegate)
\warning This is an experimental API and subject to change.
|
int |
GetBufferHandle(int tensor_index,
IntPointer buffer_handle,
TfLiteDelegate delegate) |
BytePointer |
GetInputName(int index)
Return the name of a given input.
|
BytePointer |
GetOutputName(int index)
Return the name of a given output.
|
Profiler |
GetProfiler()
\warning This is an experimental API and subject to change.
|
SignatureRunner |
GetSignatureRunner(BytePointer signature_key)
\brief Returns a pointer to the SignatureRunner instance to run the part
of the graph identified by a SignatureDef.
|
SignatureRunner |
GetSignatureRunner(String signature_key) |
int |
GetSubgraphIndexFromSignature(BytePointer signature_key)
\warning Experimental interface, subject to change.
|
int |
GetSubgraphIndexFromSignature(String signature_key) |
TfLiteTensor |
input_tensor_by_signature(BytePointer signature_input_name,
BytePointer signature_key)
\brief Returns the input tensor identified by 'signature_input_name' in
the signature identified by 'signature_key'.
|
TfLiteTensor |
input_tensor_by_signature(String signature_input_name,
String signature_key) |
TfLiteTensor |
input_tensor(long index)
Return a mutable pointer to the given input tensor.
|
IntPointer |
inputs()
Read only access to list of inputs.
|
int |
Invoke()
Invoke the interpreter (run the whole graph in dependency order).
|
static int |
kTensorsCapacityHeadroom()
The capacity headroom of the tensors vector before calling ops'
prepare and invoke function. |
static int |
kTensorsReservedCapacity()
The default capacity of the tensors vector.
|
int |
ModifyGraphWithDelegate(TfLiteDelegate delegate)
\brief Allow a delegate to look at the graph and modify the graph to
handle parts of the graph themselves.
|
int |
ModifyGraphWithDelegate(TfLiteOpaqueDelegateStruct delegate) |
RegistrationNodePair |
node_and_registration(int node_index)
Returns a pointer to an operation and registration data structure if in
bounds from the primary subgraph(subgraph_[0]).
|
RegistrationNodePair |
node_and_registration(int subgraph_index,
int node_index)
Returns a pointer to an operation and registration data structure if in
bounds.
|
long |
nodes_size()
Return the number of ops in the model.
|
BytePointer |
OpProfilingString(TfLiteRegistration op_reg,
TfLiteNode node)
Retrieve an operator's description of its work, for profiling purposes.
|
TfLiteTensor |
output_tensor_by_signature(BytePointer signature_output_name,
BytePointer signature_key)
\brief Returns the output tensor identified by 'signature_output_name' in
the signature identified by 'signature_key'.
|
TfLiteTensor |
output_tensor_by_signature(String signature_output_name,
String signature_key) |
TfLiteTensor |
output_tensor(long index)
Return a mutable pointer to the given output tensor.
|
IntPointer |
outputs()
Read only access to list of outputs.
|
Subgraph |
primary_subgraph()
\warning Experimental interface, subject to change.
|
int |
ReleaseNonPersistentMemory()
\warning Experimental interface, subject to change.
|
int |
ResetVariableTensors()
\warning This is an experimental API and subject to change.
|
int |
ResizeInputTensor(int tensor_index,
int[] dims) |
int |
ResizeInputTensor(int tensor_index,
IntBuffer dims) |
int |
ResizeInputTensor(int tensor_index,
IntPointer dims)
Change the dimensionality of a given tensor.
|
int |
ResizeInputTensorStrict(int tensor_index,
int[] dims) |
int |
ResizeInputTensorStrict(int tensor_index,
IntBuffer dims) |
int |
ResizeInputTensorStrict(int tensor_index,
IntPointer dims)
Change the dimensionality of a given tensor.
|
void |
SetAllowBufferHandleOutput(boolean allow_buffer_handle_output)
\warning This is an experimental API and subject to change.
|
void |
SetAllowFp16PrecisionForFp32(boolean allow)
Allow float16 precision for FP32 calculation when possible.
|
int |
SetBufferHandle(int tensor_index,
int buffer_handle,
TfLiteDelegate delegate)
\warning This is an experimental API and subject to change.
|
int |
SetBufferHandle(TfLiteTensor tensor,
int buffer_handle,
TfLiteDelegate delegate)
\warning This is an experimental API and subject to change.
|
void |
SetCancellationFunction(Pointer data,
Interpreter.Check_cancelled_func_Pointer check_cancelled_func) |
int |
SetCustomAllocationForTensor(int tensor_index,
TfLiteCustomAllocation allocation) |
int |
SetCustomAllocationForTensor(int tensor_index,
TfLiteCustomAllocation allocation,
long flags)
\brief Assigns (or reassigns) a custom memory allocation for the given
tensor.
|
void |
SetExternalContext(int type,
TfLiteExternalContext ctx) |
int |
SetInputs(int[] inputs) |
int |
SetInputs(IntBuffer inputs) |
int |
SetInputs(IntPointer inputs)
Provide a list of tensor indexes that are inputs to the model.
|
int |
SetNumThreads(int num_threads)
Set the number of threads available to the interpreter.
|
int |
SetOutputs(int[] outputs) |
int |
SetOutputs(IntBuffer outputs) |
int |
SetOutputs(IntPointer outputs)
Provide a list of tensor indexes that are outputs to the model
Each index is bound check and this modifies the consistent_ flag of the
interpreter.
|
void |
SetProfiler(Profiler profiler)
\warning This is an experimental API and subject to change.
|
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
BytePointer name,
int[] dims,
TfLiteQuantization quantization,
BytePointer buffer,
long bytes) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
BytePointer name,
int[] dims,
TfLiteQuantization quantization,
BytePointer buffer,
long bytes,
Allocation allocation) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
BytePointer name,
int[] dims,
TfLiteQuantizationParams quantization,
BytePointer buffer,
long bytes) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
BytePointer name,
int[] dims,
TfLiteQuantizationParams quantization,
BytePointer buffer,
long bytes,
Allocation allocation) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
BytePointer name,
IntBuffer dims,
TfLiteQuantization quantization,
BytePointer buffer,
long bytes) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
BytePointer name,
IntBuffer dims,
TfLiteQuantization quantization,
BytePointer buffer,
long bytes,
Allocation allocation) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
BytePointer name,
IntBuffer dims,
TfLiteQuantizationParams quantization,
BytePointer buffer,
long bytes) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
BytePointer name,
IntBuffer dims,
TfLiteQuantizationParams quantization,
BytePointer buffer,
long bytes,
Allocation allocation) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
BytePointer name,
IntPointer dims,
TfLiteQuantization quantization,
BytePointer buffer,
long bytes) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
BytePointer name,
IntPointer dims,
TfLiteQuantization quantization,
BytePointer buffer,
long bytes,
Allocation allocation)
Set description of inputs/outputs/data/fptrs for node
node_index . |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
BytePointer name,
IntPointer dims,
TfLiteQuantizationParams quantization,
BytePointer buffer,
long bytes) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
BytePointer name,
IntPointer dims,
TfLiteQuantizationParams quantization,
BytePointer buffer,
long bytes,
Allocation allocation)
Legacy.
|
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
BytePointer name,
long rank,
int[] dims,
TfLiteQuantizationParams quantization,
BytePointer buffer,
long bytes) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
BytePointer name,
long rank,
int[] dims,
TfLiteQuantizationParams quantization,
BytePointer buffer,
long bytes,
Allocation allocation) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
BytePointer name,
long rank,
IntBuffer dims,
TfLiteQuantizationParams quantization,
BytePointer buffer,
long bytes) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
BytePointer name,
long rank,
IntBuffer dims,
TfLiteQuantizationParams quantization,
BytePointer buffer,
long bytes,
Allocation allocation) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
BytePointer name,
long rank,
IntPointer dims,
TfLiteQuantizationParams quantization,
BytePointer buffer,
long bytes) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
BytePointer name,
long rank,
IntPointer dims,
TfLiteQuantizationParams quantization,
BytePointer buffer,
long bytes,
Allocation allocation) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
String name,
int[] dims,
TfLiteQuantizationParams quantization,
String buffer,
long bytes) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
String name,
int[] dims,
TfLiteQuantizationParams quantization,
String buffer,
long bytes,
Allocation allocation) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
String name,
int[] dims,
TfLiteQuantization quantization,
String buffer,
long bytes) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
String name,
int[] dims,
TfLiteQuantization quantization,
String buffer,
long bytes,
Allocation allocation) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
String name,
IntBuffer dims,
TfLiteQuantizationParams quantization,
String buffer,
long bytes) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
String name,
IntBuffer dims,
TfLiteQuantizationParams quantization,
String buffer,
long bytes,
Allocation allocation) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
String name,
IntBuffer dims,
TfLiteQuantization quantization,
String buffer,
long bytes) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
String name,
IntBuffer dims,
TfLiteQuantization quantization,
String buffer,
long bytes,
Allocation allocation) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
String name,
IntPointer dims,
TfLiteQuantizationParams quantization,
String buffer,
long bytes) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
String name,
IntPointer dims,
TfLiteQuantizationParams quantization,
String buffer,
long bytes,
Allocation allocation) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
String name,
IntPointer dims,
TfLiteQuantization quantization,
String buffer,
long bytes) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
String name,
IntPointer dims,
TfLiteQuantization quantization,
String buffer,
long bytes,
Allocation allocation) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
String name,
long rank,
int[] dims,
TfLiteQuantizationParams quantization,
String buffer,
long bytes) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
String name,
long rank,
int[] dims,
TfLiteQuantizationParams quantization,
String buffer,
long bytes,
Allocation allocation) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
String name,
long rank,
IntBuffer dims,
TfLiteQuantizationParams quantization,
String buffer,
long bytes) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
String name,
long rank,
IntBuffer dims,
TfLiteQuantizationParams quantization,
String buffer,
long bytes,
Allocation allocation) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
String name,
long rank,
IntPointer dims,
TfLiteQuantizationParams quantization,
String buffer,
long bytes) |
int |
SetTensorParametersReadOnly(int tensor_index,
int type,
String name,
long rank,
IntPointer dims,
TfLiteQuantizationParams quantization,
String buffer,
long bytes,
Allocation allocation) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
BytePointer name,
int[] dims,
TfLiteQuantization quantization) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
BytePointer name,
int[] dims,
TfLiteQuantization quantization,
boolean is_variable) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
BytePointer name,
int[] dims,
TfLiteQuantizationParams quantization) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
BytePointer name,
int[] dims,
TfLiteQuantizationParams quantization,
boolean is_variable,
int[] dims_signature) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
BytePointer name,
IntBuffer dims,
TfLiteQuantization quantization) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
BytePointer name,
IntBuffer dims,
TfLiteQuantization quantization,
boolean is_variable) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
BytePointer name,
IntBuffer dims,
TfLiteQuantizationParams quantization) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
BytePointer name,
IntBuffer dims,
TfLiteQuantizationParams quantization,
boolean is_variable,
IntBuffer dims_signature) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
BytePointer name,
IntPointer dims,
TfLiteQuantization quantization) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
BytePointer name,
IntPointer dims,
TfLiteQuantization quantization,
boolean is_variable)
Set description of inputs/outputs/data/fptrs for node
node_index . |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
BytePointer name,
IntPointer dims,
TfLiteQuantizationParams quantization) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
BytePointer name,
IntPointer dims,
TfLiteQuantizationParams quantization,
boolean is_variable,
IntPointer dims_signature)
Legacy.
|
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
BytePointer name,
long rank,
int[] dims,
TfLiteQuantizationParams quantization) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
BytePointer name,
long rank,
int[] dims,
TfLiteQuantizationParams quantization,
boolean is_variable,
long rank_dims_signature,
int[] dims_signature) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
BytePointer name,
long rank,
IntBuffer dims,
TfLiteQuantizationParams quantization) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
BytePointer name,
long rank,
IntBuffer dims,
TfLiteQuantizationParams quantization,
boolean is_variable,
long rank_dims_signature,
IntBuffer dims_signature) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
BytePointer name,
long rank,
IntPointer dims,
TfLiteQuantizationParams quantization) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
BytePointer name,
long rank,
IntPointer dims,
TfLiteQuantizationParams quantization,
boolean is_variable,
long rank_dims_signature,
IntPointer dims_signature) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
String name,
int[] dims,
TfLiteQuantization quantization) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
String name,
int[] dims,
TfLiteQuantization quantization,
boolean is_variable) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
String name,
int[] dims,
TfLiteQuantizationParams quantization) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
String name,
int[] dims,
TfLiteQuantizationParams quantization,
boolean is_variable,
int[] dims_signature) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
String name,
IntBuffer dims,
TfLiteQuantization quantization) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
String name,
IntBuffer dims,
TfLiteQuantization quantization,
boolean is_variable) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
String name,
IntBuffer dims,
TfLiteQuantizationParams quantization) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
String name,
IntBuffer dims,
TfLiteQuantizationParams quantization,
boolean is_variable,
IntBuffer dims_signature) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
String name,
IntPointer dims,
TfLiteQuantization quantization) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
String name,
IntPointer dims,
TfLiteQuantization quantization,
boolean is_variable) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
String name,
IntPointer dims,
TfLiteQuantizationParams quantization) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
String name,
IntPointer dims,
TfLiteQuantizationParams quantization,
boolean is_variable,
IntPointer dims_signature) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
String name,
long rank,
int[] dims,
TfLiteQuantizationParams quantization) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
String name,
long rank,
int[] dims,
TfLiteQuantizationParams quantization,
boolean is_variable,
long rank_dims_signature,
int[] dims_signature) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
String name,
long rank,
IntBuffer dims,
TfLiteQuantizationParams quantization) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
String name,
long rank,
IntBuffer dims,
TfLiteQuantizationParams quantization,
boolean is_variable,
long rank_dims_signature,
IntBuffer dims_signature) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
String name,
long rank,
IntPointer dims,
TfLiteQuantizationParams quantization) |
int |
SetTensorParametersReadWrite(int tensor_index,
int type,
String name,
long rank,
IntPointer dims,
TfLiteQuantizationParams quantization,
boolean is_variable,
long rank_dims_signature,
IntPointer dims_signature) |
int |
SetVariables(int[] variables) |
int |
SetVariables(IntBuffer variables) |
int |
SetVariables(IntPointer variables)
Provide a list of tensor indexes that are variable tensors.
|
StringIntMap |
signature_inputs(BytePointer signature_key)
\brief Returns the mapping of inputs to tensor index in the signature
specified through 'signature_key'.
|
StringIntMap |
signature_inputs(String signature_key) |
StringVector |
signature_keys()
\brief Returns list of all keys of different method signatures defined
in the model.
|
StringIntMap |
signature_outputs(BytePointer signature_key)
\brief Returns the mapping of outputs to tensor index in the signature
specified through 'signature_key'.
|
StringIntMap |
signature_outputs(String signature_key) |
Subgraph |
subgraph(int subgraph_index)
\warning This is an experimental API and subject to change.
|
long |
subgraphs_size()
\warning This is an experimental API and subject to change.
|
TfLiteTensor |
tensor(int tensor_index)
Get a mutable tensor data structure.
|
long |
tensors_size()
Return the number of tensors in the model.
|
BoolPointer |
typed_input_tensor_bool(int index) |
BytePointer |
typed_input_tensor_byte(int index)
Return a mutable pointer into the data of a given input tensor.
|
DoublePointer |
typed_input_tensor_double(int index) |
FloatPointer |
typed_input_tensor_float(int index) |
TfLiteFloat16 |
typed_input_tensor_float16(int index) |
IntPointer |
typed_input_tensor_int(int index) |
LongPointer |
typed_input_tensor_long(int index) |
ShortPointer |
typed_input_tensor_short(int index) |
BoolPointer |
typed_output_tensor_bool(int index) |
BytePointer |
typed_output_tensor_byte(int index)
Return a mutable pointer into the data of a given output tensor.
|
DoublePointer |
typed_output_tensor_double(int index) |
FloatPointer |
typed_output_tensor_float(int index) |
IntPointer |
typed_output_tensor_int(int index) |
LongPointer |
typed_output_tensor_long(int index) |
ShortPointer |
typed_output_tensor_short(int index) |
BoolPointer |
typed_tensor_bool(int tensor_index) |
BytePointer |
typed_tensor_byte(int tensor_index)
Perform a checked cast to the appropriate tensor type (mutable pointer
version).
|
DoublePointer |
typed_tensor_double(int tensor_index) |
FloatPointer |
typed_tensor_float(int tensor_index) |
TfLiteFloat16 |
typed_tensor_float16(int tensor_index) |
IntPointer |
typed_tensor_int(int tensor_index) |
LongPointer |
typed_tensor_long(int tensor_index) |
ShortPointer |
typed_tensor_short(int tensor_index) |
IntPointer |
variables()
Read only access to list of variable tensors.
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public static final int kTensorsReservedCapacity
public static final int kTensorsCapacityHeadroom
public Interpreter(Pointer p)
Pointer(Pointer)
.public Interpreter(ErrorReporter error_reporter)
public Interpreter()
@Cast(value="TfLiteStatus") public int SetInputs(@StdVector IntPointer inputs)
@Cast(value="TfLiteStatus") public int SetInputs(@StdVector IntBuffer inputs)
@Cast(value="TfLiteStatus") public int SetInputs(@StdVector int[] inputs)
@Cast(value="TfLiteStatus") public int SetOutputs(@StdVector IntPointer outputs)
@Cast(value="TfLiteStatus") public int SetOutputs(@StdVector IntBuffer outputs)
@Cast(value="TfLiteStatus") public int SetOutputs(@StdVector int[] outputs)
@Cast(value="TfLiteStatus") public int SetVariables(@StdVector IntPointer variables)
@Cast(value="TfLiteStatus") public int SetVariables(@StdVector IntBuffer variables)
@Cast(value="TfLiteStatus") public int SetVariables(@StdVector int[] variables)
@Cast(value="TfLiteStatus") public int AddNodeWithParameters(@StdVector IntPointer inputs, @StdVector IntPointer outputs, @Cast(value="const char*") BytePointer init_data, @Cast(value="size_t") long init_data_size, Pointer builtin_data, @Const TfLiteRegistration registration, IntPointer node_index)
node_index
(optionally). Interpreter will take ownership of
builtin_data
and destroy it with free
. Ownership of 'init_data'
remains with the caller.@Cast(value="TfLiteStatus") public int AddNodeWithParameters(@StdVector IntPointer inputs, @StdVector IntPointer outputs, @Cast(value="const char*") BytePointer init_data, @Cast(value="size_t") long init_data_size, Pointer builtin_data, @Const TfLiteRegistration registration)
@Cast(value="TfLiteStatus") public int AddNodeWithParameters(@StdVector IntBuffer inputs, @StdVector IntBuffer outputs, String init_data, @Cast(value="size_t") long init_data_size, Pointer builtin_data, @Const TfLiteRegistration registration, IntBuffer node_index)
@Cast(value="TfLiteStatus") public int AddNodeWithParameters(@StdVector IntBuffer inputs, @StdVector IntBuffer outputs, String init_data, @Cast(value="size_t") long init_data_size, Pointer builtin_data, @Const TfLiteRegistration registration)
@Cast(value="TfLiteStatus") public int AddNodeWithParameters(@StdVector int[] inputs, @StdVector int[] outputs, @Cast(value="const char*") BytePointer init_data, @Cast(value="size_t") long init_data_size, Pointer builtin_data, @Const TfLiteRegistration registration, int[] node_index)
@Cast(value="TfLiteStatus") public int AddNodeWithParameters(@StdVector int[] inputs, @StdVector int[] outputs, @Cast(value="const char*") BytePointer init_data, @Cast(value="size_t") long init_data_size, Pointer builtin_data, @Const TfLiteRegistration registration)
@Cast(value="TfLiteStatus") public int AddNodeWithParameters(@StdVector IntPointer inputs, @StdVector IntPointer outputs, String init_data, @Cast(value="size_t") long init_data_size, Pointer builtin_data, @Const TfLiteRegistration registration, IntPointer node_index)
@Cast(value="TfLiteStatus") public int AddNodeWithParameters(@StdVector IntPointer inputs, @StdVector IntPointer outputs, String init_data, @Cast(value="size_t") long init_data_size, Pointer builtin_data, @Const TfLiteRegistration registration)
@Cast(value="TfLiteStatus") public int AddNodeWithParameters(@StdVector IntBuffer inputs, @StdVector IntBuffer outputs, @Cast(value="const char*") BytePointer init_data, @Cast(value="size_t") long init_data_size, Pointer builtin_data, @Const TfLiteRegistration registration, IntBuffer node_index)
@Cast(value="TfLiteStatus") public int AddNodeWithParameters(@StdVector IntBuffer inputs, @StdVector IntBuffer outputs, @Cast(value="const char*") BytePointer init_data, @Cast(value="size_t") long init_data_size, Pointer builtin_data, @Const TfLiteRegistration registration)
@Cast(value="TfLiteStatus") public int AddNodeWithParameters(@StdVector int[] inputs, @StdVector int[] outputs, String init_data, @Cast(value="size_t") long init_data_size, Pointer builtin_data, @Const TfLiteRegistration registration, int[] node_index)
@Cast(value="TfLiteStatus") public int AddNodeWithParameters(@StdVector int[] inputs, @StdVector int[] outputs, String init_data, @Cast(value="size_t") long init_data_size, Pointer builtin_data, @Const TfLiteRegistration registration)
@Cast(value="TfLiteStatus") public int AddTensors(int tensors_to_add, IntPointer first_new_tensor_index)
tensors_to_add
tensors, preserving pre-existing Tensor entries.
The value pointed to by first_new_tensor_index
will be set to the
index of the first new tensor if first_new_tensor_index
is non-null.@Cast(value="TfLiteStatus") public int AddTensors(int tensors_to_add, IntBuffer first_new_tensor_index)
@Cast(value="TfLiteStatus") public int AddTensors(int tensors_to_add, int[] first_new_tensor_index)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector IntPointer dims, @ByVal TfLiteQuantization quantization, @Cast(value="const char*") BytePointer buffer, @Cast(value="size_t") long bytes, @Const Allocation allocation)
node_index
.
This variant assumes an external buffer has been allocated of size
bytes. The lifetime of buffer must be ensured to be greater or equal
to Interpreter.@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector IntPointer dims, @ByVal TfLiteQuantization quantization, @Cast(value="const char*") BytePointer buffer, @Cast(value="size_t") long bytes)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector IntBuffer dims, @ByVal TfLiteQuantization quantization, String buffer, @Cast(value="size_t") long bytes, @Const Allocation allocation)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector IntBuffer dims, @ByVal TfLiteQuantization quantization, String buffer, @Cast(value="size_t") long bytes)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector int[] dims, @ByVal TfLiteQuantization quantization, @Cast(value="const char*") BytePointer buffer, @Cast(value="size_t") long bytes, @Const Allocation allocation)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector int[] dims, @ByVal TfLiteQuantization quantization, @Cast(value="const char*") BytePointer buffer, @Cast(value="size_t") long bytes)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector IntPointer dims, @ByVal TfLiteQuantization quantization, String buffer, @Cast(value="size_t") long bytes, @Const Allocation allocation)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector IntPointer dims, @ByVal TfLiteQuantization quantization, String buffer, @Cast(value="size_t") long bytes)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector IntBuffer dims, @ByVal TfLiteQuantization quantization, @Cast(value="const char*") BytePointer buffer, @Cast(value="size_t") long bytes, @Const Allocation allocation)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector IntBuffer dims, @ByVal TfLiteQuantization quantization, @Cast(value="const char*") BytePointer buffer, @Cast(value="size_t") long bytes)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector int[] dims, @ByVal TfLiteQuantization quantization, String buffer, @Cast(value="size_t") long bytes, @Const Allocation allocation)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector int[] dims, @ByVal TfLiteQuantization quantization, String buffer, @Cast(value="size_t") long bytes)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector IntPointer dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="const char*") BytePointer buffer, @Cast(value="size_t") long bytes, @Const Allocation allocation)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector IntPointer dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="const char*") BytePointer buffer, @Cast(value="size_t") long bytes)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector IntBuffer dims, @ByVal TfLiteQuantizationParams quantization, String buffer, @Cast(value="size_t") long bytes, @Const Allocation allocation)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector IntBuffer dims, @ByVal TfLiteQuantizationParams quantization, String buffer, @Cast(value="size_t") long bytes)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector int[] dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="const char*") BytePointer buffer, @Cast(value="size_t") long bytes, @Const Allocation allocation)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector int[] dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="const char*") BytePointer buffer, @Cast(value="size_t") long bytes)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector IntPointer dims, @ByVal TfLiteQuantizationParams quantization, String buffer, @Cast(value="size_t") long bytes, @Const Allocation allocation)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector IntPointer dims, @ByVal TfLiteQuantizationParams quantization, String buffer, @Cast(value="size_t") long bytes)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector IntBuffer dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="const char*") BytePointer buffer, @Cast(value="size_t") long bytes, @Const Allocation allocation)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector IntBuffer dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="const char*") BytePointer buffer, @Cast(value="size_t") long bytes)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector int[] dims, @ByVal TfLiteQuantizationParams quantization, String buffer, @Cast(value="size_t") long bytes, @Const Allocation allocation)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector int[] dims, @ByVal TfLiteQuantizationParams quantization, String buffer, @Cast(value="size_t") long bytes)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @Cast(value="size_t") long rank, @Const IntPointer dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="const char*") BytePointer buffer, @Cast(value="size_t") long bytes, @Const Allocation allocation)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @Cast(value="size_t") long rank, @Const IntPointer dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="const char*") BytePointer buffer, @Cast(value="size_t") long bytes)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, String name, @Cast(value="size_t") long rank, @Const IntBuffer dims, @ByVal TfLiteQuantizationParams quantization, String buffer, @Cast(value="size_t") long bytes, @Const Allocation allocation)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, String name, @Cast(value="size_t") long rank, @Const IntBuffer dims, @ByVal TfLiteQuantizationParams quantization, String buffer, @Cast(value="size_t") long bytes)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @Cast(value="size_t") long rank, @Const int[] dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="const char*") BytePointer buffer, @Cast(value="size_t") long bytes, @Const Allocation allocation)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @Cast(value="size_t") long rank, @Const int[] dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="const char*") BytePointer buffer, @Cast(value="size_t") long bytes)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, String name, @Cast(value="size_t") long rank, @Const IntPointer dims, @ByVal TfLiteQuantizationParams quantization, String buffer, @Cast(value="size_t") long bytes, @Const Allocation allocation)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, String name, @Cast(value="size_t") long rank, @Const IntPointer dims, @ByVal TfLiteQuantizationParams quantization, String buffer, @Cast(value="size_t") long bytes)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @Cast(value="size_t") long rank, @Const IntBuffer dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="const char*") BytePointer buffer, @Cast(value="size_t") long bytes, @Const Allocation allocation)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @Cast(value="size_t") long rank, @Const IntBuffer dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="const char*") BytePointer buffer, @Cast(value="size_t") long bytes)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, String name, @Cast(value="size_t") long rank, @Const int[] dims, @ByVal TfLiteQuantizationParams quantization, String buffer, @Cast(value="size_t") long bytes, @Const Allocation allocation)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadOnly(int tensor_index, @Cast(value="TfLiteType") int type, String name, @Cast(value="size_t") long rank, @Const int[] dims, @ByVal TfLiteQuantizationParams quantization, String buffer, @Cast(value="size_t") long bytes)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector IntPointer dims, @ByVal TfLiteQuantization quantization, @Cast(value="bool") boolean is_variable)
node_index
.
This variant assumes an external buffer has been allocated of size
bytes. The lifetime of buffer must be ensured to be greater or equal
to Interpreter.@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector IntPointer dims, @ByVal TfLiteQuantization quantization)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector IntBuffer dims, @ByVal TfLiteQuantization quantization, @Cast(value="bool") boolean is_variable)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector IntBuffer dims, @ByVal TfLiteQuantization quantization)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector int[] dims, @ByVal TfLiteQuantization quantization, @Cast(value="bool") boolean is_variable)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector int[] dims, @ByVal TfLiteQuantization quantization)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector IntPointer dims, @ByVal TfLiteQuantization quantization, @Cast(value="bool") boolean is_variable)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector IntPointer dims, @ByVal TfLiteQuantization quantization)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector IntBuffer dims, @ByVal TfLiteQuantization quantization, @Cast(value="bool") boolean is_variable)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector IntBuffer dims, @ByVal TfLiteQuantization quantization)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector int[] dims, @ByVal TfLiteQuantization quantization, @Cast(value="bool") boolean is_variable)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector int[] dims, @ByVal TfLiteQuantization quantization)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector IntPointer dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="bool") boolean is_variable, @StdVector IntPointer dims_signature)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector IntPointer dims, @ByVal TfLiteQuantizationParams quantization)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector IntBuffer dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="bool") boolean is_variable, @StdVector IntBuffer dims_signature)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector IntBuffer dims, @ByVal TfLiteQuantizationParams quantization)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector int[] dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="bool") boolean is_variable, @StdVector int[] dims_signature)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector int[] dims, @ByVal TfLiteQuantizationParams quantization)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector IntPointer dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="bool") boolean is_variable, @StdVector IntPointer dims_signature)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector IntPointer dims, @ByVal TfLiteQuantizationParams quantization)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector IntBuffer dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="bool") boolean is_variable, @StdVector IntBuffer dims_signature)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @StdVector IntBuffer dims, @ByVal TfLiteQuantizationParams quantization)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector int[] dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="bool") boolean is_variable, @StdVector int[] dims_signature)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, String name, @StdVector int[] dims, @ByVal TfLiteQuantizationParams quantization)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @Cast(value="size_t") long rank, @Const IntPointer dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="bool") boolean is_variable, @Cast(value="size_t") long rank_dims_signature, @Const IntPointer dims_signature)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @Cast(value="size_t") long rank, @Const IntPointer dims, @ByVal TfLiteQuantizationParams quantization)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, String name, @Cast(value="size_t") long rank, @Const IntBuffer dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="bool") boolean is_variable, @Cast(value="size_t") long rank_dims_signature, @Const IntBuffer dims_signature)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, String name, @Cast(value="size_t") long rank, @Const IntBuffer dims, @ByVal TfLiteQuantizationParams quantization)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @Cast(value="size_t") long rank, @Const int[] dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="bool") boolean is_variable, @Cast(value="size_t") long rank_dims_signature, @Const int[] dims_signature)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @Cast(value="size_t") long rank, @Const int[] dims, @ByVal TfLiteQuantizationParams quantization)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, String name, @Cast(value="size_t") long rank, @Const IntPointer dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="bool") boolean is_variable, @Cast(value="size_t") long rank_dims_signature, @Const IntPointer dims_signature)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, String name, @Cast(value="size_t") long rank, @Const IntPointer dims, @ByVal TfLiteQuantizationParams quantization)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @Cast(value="size_t") long rank, @Const IntBuffer dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="bool") boolean is_variable, @Cast(value="size_t") long rank_dims_signature, @Const IntBuffer dims_signature)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, @Cast(value="const char*") BytePointer name, @Cast(value="size_t") long rank, @Const IntBuffer dims, @ByVal TfLiteQuantizationParams quantization)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, String name, @Cast(value="size_t") long rank, @Const int[] dims, @ByVal TfLiteQuantizationParams quantization, @Cast(value="bool") boolean is_variable, @Cast(value="size_t") long rank_dims_signature, @Const int[] dims_signature)
@Cast(value="TfLiteStatus") public int SetTensorParametersReadWrite(int tensor_index, @Cast(value="TfLiteType") int type, String name, @Cast(value="size_t") long rank, @Const int[] dims, @ByVal TfLiteQuantizationParams quantization)
@Cast(value="TfLiteStatus") public int EnableCancellation()
Cancel
.
This can be only set when building the interpreter and should not called
directly.
NOTE: This function does not affect cancellation triggered by the callback
passed in SetCancellationFunction
.@StdVector public IntPointer inputs()
@Cast(value="const char*") public BytePointer GetInputName(int index)
@StdVector public IntPointer outputs()
@StdVector public IntPointer variables()
@Cast(value="const char*") public BytePointer GetOutputName(int index)
@Cast(value="size_t") public long tensors_size()
@StdVector public IntPointer execution_plan()
public TfLiteTensor tensor(int tensor_index)
@Const public RegistrationNodePair node_and_registration(int node_index)
@Const public RegistrationNodePair node_and_registration(int subgraph_index, int node_index)
@Name(value="typed_tensor<int8_t>") public BytePointer typed_tensor_byte(int tensor_index)
@Name(value="typed_tensor<int16_t>") public ShortPointer typed_tensor_short(int tensor_index)
@Name(value="typed_tensor<int32_t>") public IntPointer typed_tensor_int(int tensor_index)
@Cast(value="int64_t*") @Name(value="typed_tensor<int64_t>") public LongPointer typed_tensor_long(int tensor_index)
@Name(value="typed_tensor<float>") public FloatPointer typed_tensor_float(int tensor_index)
@Name(value="typed_tensor<double>") public DoublePointer typed_tensor_double(int tensor_index)
@Cast(value="bool*") @Name(value="typed_tensor<bool>") public BoolPointer typed_tensor_bool(int tensor_index)
@Name(value="typed_tensor<TfLiteFloat16>") public TfLiteFloat16 typed_tensor_float16(int tensor_index)
@ByVal public StringVector signature_keys()
public SignatureRunner GetSignatureRunner(@Cast(value="const char*") BytePointer signature_key)
SignatureRunner
without applying default delegates,
use BuiltinOpResolverWithoutDefaultDelegates
.public SignatureRunner GetSignatureRunner(String signature_key)
public int GetSubgraphIndexFromSignature(@Cast(value="const char*") BytePointer signature_key)
public int GetSubgraphIndexFromSignature(String signature_key)
@Const @ByRef public StringIntMap signature_inputs(@Cast(value="const char*") BytePointer signature_key)
@Const @ByRef public StringIntMap signature_inputs(String signature_key)
@Const @ByRef public StringIntMap signature_outputs(@Cast(value="const char*") BytePointer signature_key)
@Const @ByRef public StringIntMap signature_outputs(String signature_key)
public TfLiteTensor input_tensor_by_signature(@Cast(value="const char*") BytePointer signature_input_name, @Cast(value="const char*") BytePointer signature_key)
public TfLiteTensor input_tensor_by_signature(String signature_input_name, String signature_key)
@Const public TfLiteTensor output_tensor_by_signature(@Cast(value="const char*") BytePointer signature_output_name, @Cast(value="const char*") BytePointer signature_key)
@Const public TfLiteTensor output_tensor_by_signature(String signature_output_name, String signature_key)
public TfLiteTensor input_tensor(@Cast(value="size_t") long index)
@Name(value="typed_input_tensor<int8_t>") public BytePointer typed_input_tensor_byte(int index)
@Name(value="typed_input_tensor<int16_t>") public ShortPointer typed_input_tensor_short(int index)
@Name(value="typed_input_tensor<int32_t>") public IntPointer typed_input_tensor_int(int index)
@Cast(value="int64_t*") @Name(value="typed_input_tensor<int64_t>") public LongPointer typed_input_tensor_long(int index)
@Name(value="typed_input_tensor<float>") public FloatPointer typed_input_tensor_float(int index)
@Name(value="typed_input_tensor<double>") public DoublePointer typed_input_tensor_double(int index)
@Cast(value="bool*") @Name(value="typed_input_tensor<bool>") public BoolPointer typed_input_tensor_bool(int index)
@Name(value="typed_input_tensor<TfLiteFloat16>") public TfLiteFloat16 typed_input_tensor_float16(int index)
public TfLiteTensor output_tensor(@Cast(value="size_t") long index)
@Name(value="typed_output_tensor<int8_t>") public BytePointer typed_output_tensor_byte(int index)
@Name(value="typed_output_tensor<int16_t>") public ShortPointer typed_output_tensor_short(int index)
@Name(value="typed_output_tensor<int32_t>") public IntPointer typed_output_tensor_int(int index)
@Cast(value="int64_t*") @Name(value="typed_output_tensor<int64_t>") public LongPointer typed_output_tensor_long(int index)
@Name(value="typed_output_tensor<float>") public FloatPointer typed_output_tensor_float(int index)
@Name(value="typed_output_tensor<double>") public DoublePointer typed_output_tensor_double(int index)
@Cast(value="bool*") @Name(value="typed_output_tensor<bool>") public BoolPointer typed_output_tensor_bool(int index)
@Cast(value="TfLiteStatus") public int ResizeInputTensor(int tensor_index, @StdVector IntPointer dims)
@Cast(value="TfLiteStatus") public int ResizeInputTensor(int tensor_index, @StdVector IntBuffer dims)
@Cast(value="TfLiteStatus") public int ResizeInputTensor(int tensor_index, @StdVector int[] dims)
@Cast(value="TfLiteStatus") public int ResizeInputTensorStrict(int tensor_index, @StdVector IntPointer dims)
-1
in
the dims_signature
attribute of a TfLiteTensor
. Returns status of
failure or success. Note that this doesn't actually resize any existing
buffers. A call to AllocateTensors() is required to change the tensor
input buffer.@Cast(value="TfLiteStatus") public int ResizeInputTensorStrict(int tensor_index, @StdVector IntBuffer dims)
@Cast(value="TfLiteStatus") public int ResizeInputTensorStrict(int tensor_index, @StdVector int[] dims)
@Cast(value="TfLiteStatus") public int ReleaseNonPersistentMemory()
@Cast(value="TfLiteStatus") public int AllocateTensors()
@Cast(value="TfLiteStatus") public int Invoke()
@Cast(value="TfLiteStatus") public int SetNumThreads(int num_threads)
num_threads
should be >= -1. Setting num_threads
to 0 has the
effect to disable multithreading, which is equivalent to setting
num_threads
to 1. If set to the value -1, the number of threads used
will be implementation-defined and platform-dependent.
As TfLite interpreter could internally apply a TfLite delegate by default
(i.e. XNNPACK), the number of threads that are available to the default
delegate *should be* set via InterpreterBuilder APIs as follows:
std::unique_ptrInterpreterBuilder::SetNumThreads
, as documented above.public void SetAllowFp16PrecisionForFp32(@Cast(value="bool") boolean allow)
tflite::StatefulNnApiDelegate::Options::allow_fp16' or
TfLiteGpuDelegateOptionsV2::is_precision_loss_allowed{@code .
This method will be removed in a future release.@Cast(value="bool") public boolean GetAllowFp16PrecisionForFp32()
public void SetCancellationFunction(Pointer data, Interpreter.Check_cancelled_func_Pointer check_cancelled_func)
@Cast(value="TfLiteStatus") public int Cancel()
Invoke
s that happen after the cancellation.
Non blocking. Thread safe.
Returns kTfLiteError if cancellation is not enabled, otherwise returns
kTfLiteOk.@Cast(value="TfLiteStatus") public int ModifyGraphWithDelegate(TfLiteDelegate delegate)
@Cast(value="TfLiteStatus") public int ModifyGraphWithDelegate(TfLiteOpaqueDelegateStruct delegate)
@Cast(value="TfLiteStatus") public int EnsureTensorDataIsReadable(int tensor_index)
tensor.data
is readable. If a
delegate has been used, and SetAllowBufferHandleOutput(true)
has been
called, tensor outputs may be stored as delegate buffer handles whose data
is not directly readable until this method has been called.
In such cases, this method will copy the data from the delegate buffer
handle to CPU memory.@Cast(value="TfLiteStatus") public int SetBufferHandle(int tensor_index, @Cast(value="TfLiteBufferHandle") int buffer_handle, TfLiteDelegate delegate)
@Cast(value="TfLiteStatus") public int SetBufferHandle(TfLiteTensor tensor, @Cast(value="TfLiteBufferHandle") int buffer_handle, TfLiteDelegate delegate)
@Cast(value="TfLiteStatus") public int GetBufferHandle(int tensor_index, @Cast(value="TfLiteBufferHandle*") IntPointer buffer_handle, @Cast(value="TfLiteDelegate**") PointerPointer delegate)
@Cast(value="TfLiteStatus") public int GetBufferHandle(int tensor_index, @Cast(value="TfLiteBufferHandle*") IntPointer buffer_handle, @ByPtrPtr TfLiteDelegate delegate)
@Cast(value="TfLiteStatus") public int GetBufferHandle(int tensor_index, @Cast(value="TfLiteBufferHandle*") IntBuffer buffer_handle, @ByPtrPtr TfLiteDelegate delegate)
@Cast(value="TfLiteStatus") public int GetBufferHandle(int tensor_index, @Cast(value="TfLiteBufferHandle*") int[] buffer_handle, @ByPtrPtr TfLiteDelegate delegate)
public void SetProfiler(Profiler profiler)
profiler
is nullptr, all previously installed profilers will be
removed.public void AddProfiler(Profiler profiler)
profiler
will be ignored.public Profiler GetProfiler()
@MemberGetter public static int kTensorsReservedCapacity()
@MemberGetter public static int kTensorsCapacityHeadroom()
prepare
and invoke
function. In those functions, it's guaranteed
allocating up to this many more tensors won't invalidate
pointers to existing tensors.public void SetAllowBufferHandleOutput(@Cast(value="bool") boolean allow_buffer_handle_output)
tensor->data
by default. If the application can
consume the buffer handle directly (e.g. reading output from OpenGL
texture), it can set this flag to true, so Interpreter won't copy the
data from buffer handle to CPU memory.@Cast(value="TfLiteStatus") public int ResetVariableTensors()
@Cast(value="const char*") public BytePointer OpProfilingString(@Const @ByRef TfLiteRegistration op_reg, @Const TfLiteNode node)
public void SetExternalContext(@Cast(value="TfLiteExternalContextType") int type, TfLiteExternalContext ctx)
@Cast(value="TfLiteStatus") public int SetCustomAllocationForTensor(int tensor_index, @Const @ByRef TfLiteCustomAllocation allocation, @Cast(value="int64_t") long flags)
flags
is a bitmask, see TfLiteCustomAllocationFlags.
The runtime does NOT take ownership of the underlying memory.
NOTE: User needs to call AllocateTensors() after this.
Invalid/insufficient buffers will cause an error during AllocateTensors or
Invoke (in case of dynamic shapes in the graph).
Parameters should satisfy the following conditions:
1. tensor->allocation_type == kTfLiteArenaRw or kTfLiteArenaRwPersistent
In general, this is true for I/O tensors & variable tensors.
2. allocation->data has the appropriate permissions for runtime access
(Read-only for inputs, Read-Write for others), and outlives
Interpreter.
3. allocation->bytes >= tensor->bytes.
This condition is checked again if any tensors are resized.
4. allocation->data should be aligned to kDefaultTensorAlignment
defined in lite/util.h. (Currently 64 bytes)
This check is skipped if kTfLiteCustomAllocationFlagsSkipAlignCheck is
set through flags
.
\warning This is an experimental API and subject to change. \n@Cast(value="TfLiteStatus") public int SetCustomAllocationForTensor(int tensor_index, @Const @ByRef TfLiteCustomAllocation allocation)
@Cast(value="TfLiteStatus") public int ApplyOptions(InterpreterOptions options)
@Cast(value="size_t") public long subgraphs_size()
public Subgraph subgraph(int subgraph_index)
@ByRef public Subgraph primary_subgraph()
public ErrorReporter error_reporter()
Copyright © 2025. All rights reserved.