def at_most_zero
import bendtorch-core@0.1.0.0/src/tensor/elementwise.bend as Elementwiseimport Base
40# IEEE 754 `x <= 0`, on the bits: +0.0 (0x00000000) and the words from -0.0
41# (0x80000000) up to -inf (0xFF800000). No NaN is at most zero.
42def at_most_zero(x: F32) -> Bool:
43 +word = bits(x)
44 Bool.or(U32.is_eq(word, 0), Bool.and(U32.is_le(2147483648, word), U32.is_le(word, 4286578688)))
Uses (7)
Used by (5)
- bendtorch-core@0.1.0.0/src/tensor/elementwise:relu_backward
- bendtorch-core@0.1.0.0/src/tensor/relu_LAWS:at_most_zero_at
- bendtorch-core@0.1.0.0/src/tensor/relu_LAWS:at_most_zero_words
- bendtorch-core@0.1.0.0/src/tensor/relu_LAWS:scalar_relu_backward_passed
- bendtorch-core@0.1.0.0/src/tensor/relu_LAWS:scalar_relu_backward_zeroed