mixin ๐
Torch operations.
TorchMixin ๐
Mixin providing Torch 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, TorchMixin): ...
torch_model_load ๐
Performs the Torch model load operation.
Wraps the vaccel_torch_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/torch/mixin.py
torch_model_run ๐
torch_model_run(
resource: Resource,
in_tensors: list[Tensor],
nr_out_tensors: int = 1,
run_options: Buffer | None = None,
) -> list[Tensor]
Performs the Torch model run operation.
Wraps the vaccel_torch_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 |
| Buffer | None | The inference options. | None |
Returns:
Type | Description |
---|---|
list[Tensor] | The output tensors |
Raises:
Type | Description |
---|---|
FFIError | If the C operation fails. |