def axis_left

bendtorch-core@0.1.0.0 · src/tensor/batched_matmul_PROOF.bend:617

import bendtorch-core@0.1.0.0/src/tensor/batched_matmul_PROOF.bend as BatchedMatmulPROOF
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/batched_matmul.bend as Batched

617def axis_left(+l: U32, +r: U32, decision: Shape.BoolCase<Nat.is_eq(U32.to_nat(l), 1n)>) ->
618  AxisMeaning(l, r, Batched.stretched(l, r, False{}, Nat.is_eq(U32.to_nat(l), 1n), Nat.is_eq(U32.to_nat(r), 1n))):
619  match decision:
620    case Shape.BTrue{+equal}:
621      %equal : AxisMeaning(l, r, Batched.stretched(l, r, False{}, _, Nat.is_eq(U32.to_nat(r), 1n)))
622      %equal : {U32.to_nat(r) == Bool.pick(Nat, _, U32.to_nat(r), U32.to_nat(l)) : Nat}
623      {==}
624    case Shape.BFalse{+equal}:
625      %equal : AxisMeaning(l, r, Batched.stretched(l, r, False{}, _, Nat.is_eq(U32.to_nat(r), 1n)))
626      axis_right(l, r, equal, Shape.bool_case(Nat.is_eq(U32.to_nat(r), 1n)))

Uses (11)

Used by (1)