mixin ๐
Tensorflow Lite operations.
TFLiteMixin ๐
Mixin providing Tensorflow Lite operations for a Session.
This mixin is intended to be used in combination with BaseSession and should not be instantiated on its own.
Intended usage
class Session(BaseSession, TensorflowLiteMixin): ...
tflite_model_load ๐
Performs the Tensorflow Lite model load operation.
Wraps the vaccel_tflite_model_load() C operation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| Resource | A resource with the model to load. | required |
Raises:
| Type | Description |
|---|---|
FFIError | If the C operation fails. |
Source code in vaccel/ops/tf/lite/mixin.py
tflite_model_run ๐
tflite_model_run(
resource: Resource, in_tensors: list[Tensor], nr_out_tensors: int = 1
) -> (list[Tensor], int)
Performs the Tensorflow Lite model run operation.
Wraps the vaccel_tflite_model_run() C operation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| Resource | A resource with the model to run. | required |
| list[Tensor] | The input tensors for the inference. | required |
| int | The number of output tensors. Defaults to 1. | 1 |
Returns:
| Type | Description |
|---|---|
(list[Tensor], int) | A tuple containing: - The output tensors - The status of the operation execution. |
Raises:
| Type | Description |
|---|---|
FFIError | If the C operation fails. |
Source code in vaccel/ops/tf/lite/mixin.py
tflite_model_unload ๐
Performs the Tensorflow Lite model unload operation.
Wraps the vaccel_tflite_model_unload() C operation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| Resource | A resource with the model to unload. | required |
Returns:
| Type | Description |
|---|---|
None | The status of the operation execution. |
Raises:
| Type | Description |
|---|---|
FFIError | If the C operation fails. |