Bendtorch.relu_v: def of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/main.bend as Bendtorch Lines 752-755 of bendtorch@1.3.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/main.bend&start_line=752&end_line=755 import Base # relu(x) = x unless x < 0 (so relu(NaN) = NaN and relu(-0) = -0); its gradient is +0 where the output is <= 0 and # passes everywhere else, NaN included (PyTorch's threshold_backward) def relu_v(+x: F32) -> F32: pick(F32.is_lt(x, 0.0), 0.0, x) Uses (3): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.is_lt https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=pick