law scalar_relu_backward_zeroed
import bendtorch-core@0.1.0.0/src/tensor/relu_LAWS.bend as ReluLAWSimport Base
import bendtorch-core@0.1.0.0/src/tensor/elementwise.bend as Elementwise
88# ReluBackward is PyTorch's relu gradient, threshold_backward(g, relu(x), 0),
89# with x on the left and g on the right: +0.0 where x is at most zero, so the
90# gradient at +0.0 and -0.0 is +0.0, and g's own word otherwise, NaN x
91# included.
92law scalar_relu_backward_zeroed:
93 for +left: F32
94 for +right: F32
95 for zeroed: {Elementwise.at_most_zero(left) == True{} : Bool}
96 {Elementwise.scalar(Elementwise.ReluBackward{}, left, right) == 0.0 : F32}
Uses (7)
Used by (0)
No other definition uses this definition.