Trait autograd::op::Op [] [src]

pub trait Op {
    fn name(&self) -> &str;
fn compute(&self, ctx: OpComputeContext) -> ComputeResult;
fn grad(
        &self,
        gy: &Tensor,
        xs: &[&Tensor],
        y: &Tensor
    ) -> Vec<Option<Tensor>>; }

Operation trait. Tensor wraps trait-object of this.

Required Methods

Name of this op

Actually runs this op.

Important traits for Vec<u8>

Returns symbolic gradients for input nodes by use of output gradient etc.

Arguments

  • gy - Symbolic representation of the gradient of compute's return value
  • xs - Symbolic representation of compute::xs
  • y - Symbolic representation of compute's return value

NOTE: The number of return values must match xs.len().

Implementors