Eager Tensor Operations #
PyTorch-style tensor operations recorded on the session's tape. Each one runs the CPU or the CUDA
kernel of the operation, as the session's device selects, and preserves the typed TensorRef
surface.
Elementwise operations #
Record elementwise addition a + b. PyTorch: torch.add.
Instances For
Record elementwise subtraction a - b. PyTorch: torch.sub.
Instances For
Record elementwise multiplication a * b. PyTorch: torch.mul.
Instances For
Record elementwise division without replacing it by multiplication by a reciprocal.
Instances For
Record direct scalar negation, preserving signed zero in the forward value.
Instances For
Record scaling by a scalar constant. PyTorch: x * c.
Instances For
Record elementwise absolute value. PyTorch: torch.abs.
Instances For
Record elementwise square root. PyTorch: torch.sqrt.
Instances For
Record elementwise clamp to [minVal,maxVal]. PyTorch: torch.clamp.
Instances For
Record elementwise maximum. PyTorch: torch.maximum.
Instances For
Record elementwise minimum. PyTorch: torch.minimum.
Instances For
Record the top-k mask of x along its last axis (Spec.MoE.topKMaskSpec), a reference that
receives no gradient. CUDA computes it with a comparison kernel; the CPU tape evaluates the spec.
Instances For
Record elementwise ReLU. PyTorch: torch.relu / torch.nn.functional.relu.
Instances For
Record elementwise sigmoid. PyTorch: torch.sigmoid.
Instances For
Record elementwise tanh. PyTorch: torch.tanh.
Instances For
Record SiLU as one operation; the input is retained for its negative-tail VJP.
Instances For
Record tanh-approximate GELU as one tape operation.
Instances For
Record shape-preserving softmax over the last axis.
PyTorch comparison: torch.softmax(x, dim=-1).
Instances For
Record stable log-softmax (shape-preserving, last-axis convention).
PyTorch comparison: torch.nn.functional.log_softmax(x, dim=-1).
Instances For
Record elementwise softplus. PyTorch: torch.nn.functional.softplus.
Instances For
Record elementwise exponential. PyTorch: torch.exp.
Instances For
Record elementwise sine and dispatch its value and VJP through the selected backend.
Instances For
Record elementwise cosine with the selected backend's -sin(x) * dLdy backward rule.
Instances For
Record elementwise log. PyTorch: torch.log.
Instances For
Record elementwise inverse 1/x. PyTorch: torch.reciprocal.
Instances For
Record log(softplus(x) + ε) and its derivative.
Backward multiplies the incoming gradient by sigmoid(x) / (softplus(x) + ε). CUDA converts
ε to the input dtype; choose a value that stays positive after conversion if softplus can round to
zero. Neither backend checks positivity here or guarantees finite results for nonfinite inputs.