Trait microtensor::BinaryOp

source ·
pub trait BinaryOp<T: Real>: Debug + Send + Sync + Serialize + Deserialize {
    // Required methods
    fn run(&self, lhs: &Tensor<T>, rhs: &Tensor<T>) -> Tensor<T>;
    fn derive(
        &self,
        lhs: &Tensor<T>,
        rhs: &Tensor<T>,
        grad: &Tensor<T>
    ) -> (Tensor<T>, Tensor<T>);
}
Expand description

Binary computational operation that can also compute its derivative.

Required Methods§

source

fn run(&self, lhs: &Tensor<T>, rhs: &Tensor<T>) -> Tensor<T>

source

fn derive( &self, lhs: &Tensor<T>, rhs: &Tensor<T>, grad: &Tensor<T> ) -> (Tensor<T>, Tensor<T>)

Implementors§