def constant_at

bendtorch-core@0.1.0.0 · src/autograd/tensor_backward.bend:1060

import bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend as TensorBackward
import Base

1060# Whether node id of a newest-first list of count nodes is a constant.
1061def constant_at(nodes: List<&2, Node>, +count: Nat, +id: Nat, same: Bool) -> Bool:
1062  match nodes count same:
1063    case Nil{} count same:
1064      False{}
1065    case Con{node, rest} 0n same:
1066      False{}
1067    case Con{node, rest} 1n+below True{}:
1068      is_constant(node)
1069    case Con{node, rest} 1n+below False{}:
1070      constant_at(rest, below, id, at_head(below, id))

Uses (6)

Used by (2)