fhelium.ir.dialects.torch
Registered structural support for preserved PyTorch calls.
CallOp
class View source
python
CallOp()1
Bases: _CallOp
Preserve an opaque frontend call until an implementation is selected.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'torch.call' |
TensorCallOp
class View source
python
TensorCallOp()1
Bases: _CallOp
Apply one supported out-of-place public Tensor operation.
Targets have ordinary Torch semantics. No encrypted input interpretation, arbitrary importer, mutation through out, or random sampling is implied.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'torch.tensor_call' | |
traits | traits_def(Pure()) |
dependencies
method
python
def dependencies() -> OperationDependencies: ...1
Describe data reads in the registered target's Tensor coordinates.
TENSOR_FUNCTION_TARGETS
constant View source
python
TENSOR_FUNCTION_TARGETS = frozenset({'torch.add', 'torch.sub', 'torch.mul', 'torch.div', 'torch.neg', 'torch.pow', 'torch.roll', 'torch.matmul', 'torch.linalg.vector_norm', 'torch.sum', 'torch.mean', 'torch.sqrt', 'torch.rsqrt', 'torch.exp', 'torch.log', 'torch.sin', 'torch.cos', 'torch.tanh', 'torch.sigmoid', 'torch.relu', 'torch.reshape', 'torch.transpose', 'torch.permute', 'torch.clone', 'torch.stack', 'torch.cat', 'torch.getitem', 'torch.Tensor.to', 'torch.Tensor.contiguous'})1
OPERATION_SPECS
constant View source
python
OPERATION_SPECS: tuple[OperationSpec, ...] = (registered_operation_spec(TensorCallOp, 'pointwise', effect='pure', validator=_tensor_call_specification), registered_operation_spec(CallOp, 'auxiliary', effect='opaque', validator=_call_specification))1
Torch
data View source
python
Torch = Dialect('torch', [CallOp, TensorCallOp], [])1