Skip to main content

Module ad

Module ad 

Source
Expand description

Helpers for differentiation rules, shared by the primitives and the drivers in ruxla-transforms.

The rules follow JAX’s (jax._src.lax), so that ruxla’s derivatives compute the same as JAX’s.

Functions§

add_tangents
The sum of two tangents of the same type, skipping symbolic zeros.
bind1
Applies a primitive with one output.
convert
Converts to another type (a no-op for the same type).
differentiable
Whether an abstract value has nonzero tangents (floats only).
full
A scalar value broadcast to aval.
instantiate
The tangent as an atom, with zeros of aval for a symbolic zero.
mul_tangent
a * b, where b may be a symbolic zero.
neg_tangent
-t, skipping symbolic zeros.
scalar
A scalar literal of a type.
sub_tangents
a - b for tangents, skipping symbolic zeros.
zeros
Zeros of an abstract value.