def all_constant
import bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend as TensorBackwardimport Base
1124# Whether every id of a list is a constant of the newest-first list of count
1125# nodes.
1126def all_constant(ids: List<&2, Nat>, +nodes: List<&2, Node>, +count: Nat) -> Bool:
1127 match ids:
1128 case Nil{}:
1129 True{}
1130 case Con{+id, rest}:
1131 Bool.and(constant_at(nodes, count, id, at_head(count, id)), all_constant(rest, nodes, count))