Trait autograd::ops::Op [] [src]

pub trait Op {
    fn name(&self) -> &str;
fn grad(
        &self,
        gy: &Tensor,
        inputs: &[&Tensor],
        output: &Tensor
    ) -> Vec<Option<Tensor>>;
fn compute(&mut self, xs: &[&NdArray], train: bool) -> NdArray; }

Represents a operation node in a computation graph. Tensor wraps trait-object of this.

Required Methods

Name of this op

Returns gradient for each input node by use of output gradient.

Arguments

  • gy - Gradient of output of this op
  • inputs - Tensor level representation of compute::xs
  • output - Tensor level representation of compute's return value

Actually runs this op. num of inputs : N, num of outputs: 1

Implementors