mixin π
Tensorflow operations.
TFMixin π
Mixin providing Tensorflow 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, TensorflowMixin): ...
tf_model_delete π
Performs the Tensorflow model deletion operation.
Wraps the vaccel_tf_session_delete()
C operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
| Resource | A resource with the model to unload. | required |
Returns:
Type | Description |
---|---|
Status | The status of the operation execution. |
Raises:
Type | Description |
---|---|
FFIError | If the C operation fails. |
Source code in vaccel/ops/tf/mixin.py
tf_model_load π
Performs the Tensorflow model loading operation.
Wraps the vaccel_tf_session_load()
C operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
| Resource | A resource with the model to load. | required |
Returns:
Type | Description |
---|---|
Status | The status of the operation execution. |
Raises:
Type | Description |
---|---|
FFIError | If the C operation fails. |
Source code in vaccel/ops/tf/mixin.py
tf_model_run π
tf_model_run(
resource: Resource,
in_nodes: list[Node],
in_tensors: list[Tensor],
out_nodes: list[Node],
run_options: Buffer | None = None,
) -> (list[Tensor], Status)
Performs the Tensorflow model run operation.
Wraps the vaccel_tf_session_run()
C operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
| Resource | A resource with the model to run. | required |
| list[Node] | The input nodes for the inference. | required |
| list[Tensor] | The input tensors for the inference. | required |
| list[Node] | The output nodes for the inference. | required |
| Buffer | None | The inference options. | None |
Returns:
Type | Description |
---|---|
(list[Tensor], Status) | A tuple containing: - The output tensors - The status of the operation execution. |
Raises:
Type | Description |
---|---|
FFIError | If the C operation fails. |