Skip to main content

TensorCustomOps

Trait TensorCustomOps 

Source
pub trait TensorCustomOps<T: TensorElement> {
    // Required methods
    fn apply_custom_op(
        &self,
        op_name: &str,
        other_inputs: &[&Tensor<T>],
        params: &OperationParams,
    ) -> Result<Vec<Tensor<T>>>;
    fn apply_custom_op_with_registry(
        &self,
        registry: &CustomOperationRegistry,
        op_name: &str,
        other_inputs: &[&Tensor<T>],
        params: &OperationParams,
    ) -> Result<Vec<Tensor<T>>>;
}
Expand description

Extension trait to add custom operation support to tensors

Required Methods§

Source

fn apply_custom_op( &self, op_name: &str, other_inputs: &[&Tensor<T>], params: &OperationParams, ) -> Result<Vec<Tensor<T>>>

Apply a custom operation to this tensor

§Arguments
  • op_name - Name of the registered operation
  • other_inputs - Additional input tensors (if any)
  • params - Operation parameters
§Returns

Result tensor(s) from the operation

Source

fn apply_custom_op_with_registry( &self, registry: &CustomOperationRegistry, op_name: &str, other_inputs: &[&Tensor<T>], params: &OperationParams, ) -> Result<Vec<Tensor<T>>>

Apply a custom operation using a specific registry

Implementors§

Source§

impl<T: TensorElement + 'static> TensorCustomOps<T> for Tensor<T>