Docs / jax4j-core / com.nablatensor.jax4j.autodiff
final class
Var
A reverse-mode autodiff tape node wrapping a Tensor. Every fluent op (add/mul/matmul/...) both computes the forward Tensor value and records a local backward rule; backward() walks the recorded graph in reverse topological order, accumulating each node's gradient into its parents. AutoDiff brackets a recording session so the intermediate (non-leaf) nodes created along the way can be closed deterministically once gradients have been read out, instead of relying on GC/Cleaner timing.
Methods
Wraps a tensor as an untracked leaf: a trainable parameter or a constant. Never auto-closed.
Accumulated upstream gradient after backward(); null if never reached.
Rectified linear unit; the backward pass routes gradient only where the input was positive.
2-D convolution against weights; see ConvSpec for the layout.
Scales by a plain (non-differentiable) double, e.g. a learning rate or 1/N.
Sums every element, returning a single-element (shape (1)) node.
Sums along one axis. The backward pass broadcasts the reduced gradient to the input shape.
Sums along one axis, optionally retaining a size-one reduced dimension.
Maximum along one axis. Ties route the gradient to the first maximum, matching argmax(int).
Mean over every element, returning a single-element (shape (1)) node.
Seeds this (scalar-shaped) node's gradient with 1 and backprops through the whole tape.