TensorBackward.operands_below: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend as TensorBackward Lines 823-856 of bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend&start_line=823&end_line=856 import Base def operands_below(node: Node, +bound: Nat) -> Bool: match node: case Leaf{}: True{} case Add{a, b, left, right}: Bool.and(Nat.is_lt(a, bound), Nat.is_lt(b, bound)) case Sub{a, b, left, right}: Bool.and(Nat.is_lt(a, bound), Nat.is_lt(b, bound)) case Mul{a, b, left, right}: Bool.and(Nat.is_lt(a, bound), Nat.is_lt(b, bound)) case Sum{a, input}: Nat.is_lt(a, bound) case SumDims{a, input, kept}: Nat.is_lt(a, bound) case Matmul{a, b, left, right}: Bool.and(Nat.is_lt(a, bound), Nat.is_lt(b, bound)) case MatmulNT{a, b, left, right}: Bool.and(Nat.is_lt(a, bound), Nat.is_lt(b, bound)) case Relu{a, input}: Nat.is_lt(a, bound) case MseLoss{a, b, left, right}: Bool.and(Nat.is_lt(a, bound), Nat.is_lt(b, bound)) case CrossEntropy{a, input}: Nat.is_lt(a, bound) case BatchedMatmul{a, b, left, right}: Bool.and(Nat.is_lt(a, bound), Nat.is_lt(b, bound)) case Slice{a, input, kept, plan}: Nat.is_lt(a, bound) case Gathered{a, input, plan, entries}: Nat.is_lt(a, bound) case Constant{}: True{} case Frozen{id, inner}: operands_below(inner, bound) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_lt https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend&name=Node