Gather.matches: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/gather.bend as Gather Lines 107-115 of bendtorch-core@0.1.0.0/src/tensor/gather.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/gather.bend&start_line=107&end_line=115 import Base # Whether the index's dimensions are the input's at every axis but `dim`. def matches(dimensions: List<&2, U32>, index: List<&2, U32>, +dim: Nat) -> Bool: match dimensions index dim: case extent <> rest other <> more 0n: equal(rest, more) case extent <> rest other <> more 1n+next: Bool.and(Nat.is_eq(U32.to_nat(extent), U32.to_nat(other)), matches(rest, more, next)) case _ _ _: False{} Uses (8): 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=List 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_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/gather.bend&name=equal