fhelium.backend.torch
Execute registered public Tensor calls without changing their numerical role.
The function table is the executable scope of the Torch-call implementation. Serialized target strings never trigger arbitrary Python imports or evaluation.
TorchCallImplementation
class View source
python
TorchCallImplementation(name: str = 'torch-tensor', operation_types: tuple[type[Operation], ...] = (CallOp, TensorCallOp), supports_in_place: bool = False)1
Run one registered Tensor function with caller-supplied Tensor operands.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | str | 'torch-tensor' |
operation_types | tuple[type[Operation], ...] | (CallOp, TensorCallOp) |
supports_in_place | bool | False |
supports_operation
method
python
def supports_operation(operation: Operation) -> bool: ...1
prepare_operation
method
python
def prepare_operation(operation: Operation) -> TorchCallImplementation: ...1
resource_requirements
method
python
def resource_requirements(invocation: OperationInvocation) -> tuple[ResourceRequirement, ...]: ...1
execute
method
python
def execute(invocation: OperationInvocation, inputs: tuple[torch.Tensor, ...], resources: tuple[BoundResource, ...], *, in_place: bool) -> tuple[torch.Tensor, ...]: ...1