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
Reference to associated TfliteModel
Data quantization information
The tensor shape
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 (Optional[TfliteModel]) –
fb_tensor (Optional[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 data: ndarray¶
Tensor data
- Return type:
ndarray
- property model: TfliteModel¶
Reference to associated TfliteModel
- Return type:
TypeVar
(TfliteModel
)