Skip to content

tenzr::txpr::CustomVJPRule

A forward/backward rule pair defining the gradient of an operation that autodiff cannot derive on its own.

#include <custom_vjp.h>

Public Attributes

Name
std::function< std::pair< Array, Array >(const Array &)> fwd
Forward pass: maps a primal to its output and a saved residual.
std::function< Array(const Array &, const Array &)> bwd
Backward pass: maps (residual, out_grad) to the input gradient.

Public Attributes Documentation

variable fwd

std::function< std::pair< Array, Array >(const Array &)> fwd;

Forward pass: maps a primal to its output and a saved residual.

variable bwd

std::function< Array(const Array &, const Array &)> bwd;

Backward pass: maps (residual, out_grad) to the input gradient.