BatchedMatmulLAWS.extent: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/batched_matmul_LAWS.bend as BatchedMatmulLAWS Lines 277-283 of bendtorch-core@0.1.0.0/src/tensor/batched_matmul_LAWS.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/batched_matmul_LAWS.bend&start_line=277&end_line=283 import Base # The plan of torch.matmul, written from PyTorch's definition over the # operands' extents as naturals. # # One batch axis of two extents that broadcast: an extent of 1 takes the # other one's. def extent(+left: Nat, +right: Nat) -> Nat: Bool.pick(Nat, Nat.is_eq(left, 1n), right, left) Uses (3): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick 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