def same
import bendtorch@1.3.0.0/tensor.bend as Tensorimport Base
552# the same sizes on every axis
553def same(a: List<&2, Nat>, b: List<&2, Nat>) -> Bool:
554 match a b:
555 case Nil{} Nil{}:
556 True{}
557 case Con{+x, ra} Con{+y, rb}:
558 # bend-lint: disable-next bend-lint-rules/performance/eager_branch -- a shape predicate over a list of rank <= 4, once per operation; the types and LAWS.bend read its Bool form not-expected-because: a match would change the definition the proofs reduce, for no measurable gain
559 Bool.and(Nat.is_eq(x, y), same(ra, rb))
560 case _ _:
561 False{}