def extent

bendtorch-core@0.1.0.0 · src/tensor/batched_matmul_LAWS.bend:277

import bendtorch-core@0.1.0.0/src/tensor/batched_matmul_LAWS.bend as BatchedMatmulLAWS
import Base

277# The plan of torch.matmul, written from PyTorch's definition over the
278# operands' extents as naturals.
279#
280# One batch axis of two extents that broadcast: an extent of 1 takes the
281# other one's.
282def extent(+left: Nat, +right: Nat) -> Nat:
283  Bool.pick(Nat, Nat.is_eq(left, 1n), right, left)

Uses (3)

Used by (5)