Elementwise eager-engine operations.
This file contains scalar-lifted tensor nodes and their runtime/autograd implementation, including arithmetic, comparisons, activations, and loss-adjacent pointwise operations.
Elementwise addition. PyTorch: torch.add / +.
Instances For
Elementwise subtraction. PyTorch: torch.sub / -.
Instances For
Elementwise multiplication. PyTorch: torch.mul / *.
Instances For
Multiply a tensor by a scalar constant. PyTorch: x * c for Python scalar c.
Instances For
Elementwise absolute value.
Backward uses the sign function (sign_spec) as a subgradient at 0.
PyTorch comparison: torch.abs.
Instances For
Elementwise square root.
Backward uses 1 / (2 * sqrt(x)) for x > 0 and 0 otherwise (totalized).
PyTorch comparison: torch.sqrt.
Instances For
Elementwise clamp to [minVal, maxVal].
Backward multiplies by an indicator of the open interval (minVal, maxVal) (zero at boundaries).
PyTorch comparison: torch.clamp.
Instances For
Elementwise maximum.
Tie-breaking: when a = b, the upstream gradient is split evenly (0.5) between both inputs.
PyTorch comparison: torch.maximum.
Instances For
Elementwise minimum.
Tie-breaking: when a = b, the upstream gradient is split evenly (0.5) between both inputs.
PyTorch comparison: torch.minimum.
Instances For
Elementwise ReLU.
PyTorch comparison: torch.relu(x) / torch.nn.functional.relu(x).