mltk.core.TfliteTensor¶
- class TfliteTensor[source]¶
Wrapper for TFLite flatbuffer tensor
Properties
Tensor data
Tensor data type
Tensor data type as a string
Index of tensor in .tflite subgraph.tensors list
True if this tensor is populated at runtime and its state persists between inferences
Reference to associated TfliteModel
Data quantization information
The tensor shape
The number of bytes required to hold the data for this tensor
Methods
InitFromBuf
InitFromObj
Pack
Return the shape and data-type of this tensor as a string: <dim0>x<dim1>x.
- __init__(index=-1, model=None, fb_tensor=None)[source]¶
- Parameters:
index (int) –
model (TfliteModel) –
fb_tensor (TensorT) –
- property index: int¶
Index of tensor in .tflite subgraph.tensors list
- Return type:
int
- property dtype: dtype¶
Tensor data type
- Return type:
dtype
- property dtype_str: str¶
Tensor data type as a string
- Return type:
str
- property shape: TfliteShape¶
The tensor shape
- Return type:
- property quantization: TfliteQuantization¶
Data quantization information
- Return type:
- property is_variable: bool¶
True if this tensor is populated at runtime and its state persists between inferences
- Return type:
bool
- property size_bytes: int¶
The number of bytes required to hold the data for this tensor
- Return type:
int
- property data: ndarray¶
Tensor data
- Return type:
ndarray
- property model: TfliteModel¶
Reference to associated TfliteModel
- Return type:
TypeVar
(TfliteModel
)