mltk.core.TfliteLayer¶
- class TfliteLayer[source]¶
Wrapper for TFLite flatbuffer layer
Properties
Index of this layer in the model
List of layer input tensor(s)
Additional key/value data to associated with layer
Reference to associated TfliteModel
Return the number of inputs
Return the number of outputs
op<index>-<OpCodeStr>
OpCode numeric value
OpCode as a string
Layer-specific options/config
List of layer output tensor(s)
Methods
Instantiate a TfliteLayer from then given TfliteModel flatbuffer operation
Get layer input tensor as np.ndarray
Get layer input tensor as TfliteTensor
Layer output tensor as np.ndarray
Layer output tensor as TfliteTensor
- static from_flatbuffer(index, model, fb_operation)[source]¶
Instantiate a TfliteLayer from then given TfliteModel flatbuffer operation
- Return type:
- Parameters:
index (int) –
model (TfliteModel) –
fb_operation (OperatorT) –
- __init__(index, opcode, opcode_version, model, fb_operation)[source]¶
- Parameters:
index (int) –
opcode (BuiltinOperator) –
opcode_version (int) –
model (TfliteModel) –
fb_operation (OperatorT) –
- property index: int¶
Index of this layer in the model
- Return type:
int
- property name: str¶
op<index>-<OpCodeStr>
- Type:
Name of current layer as
- Return type:
str
- property opcode: BuiltinOperator¶
OpCode numeric value
- Return type:
BuiltinOperator
- property opcode_str: str¶
OpCode as a string
- Return type:
str
- property options: TfliteLayerOptions¶
Layer-specific options/config
- Return type:
TfliteLayerOptions
- property model: TfliteModel¶
Reference to associated TfliteModel
- Return type:
TypeVar
(TfliteModel
)
- property metadata: Dict[str, object]¶
Additional key/value data to associated with layer
- NOTE: This information is generated by the framework/Python scripts
(i.e. The information does NOT come from the .tflite model)
- Return type:
Dict
[str
,object
]
- property inputs: List[TfliteTensor]¶
List of layer input tensor(s)
- Return type:
List
[TfliteTensor
]
- property n_inputs: int¶
Return the number of inputs
- Return type:
int
- property outputs: List[TfliteTensor]¶
List of layer output tensor(s)
- Return type:
List
[TfliteTensor
]
- property n_outputs: int¶
Return the number of outputs
- Return type:
int