def axis_same

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

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/lifecycle.bend as Lifecycle
import bendtorch-core@0.1.0.0/src/tensor/batched_matmul.bend as Batched

628def axis_same(+l: U32, +r: U32, decision: Shape.BoolCase<Nat.is_eq(U32.to_nat(l), U32.to_nat(r))>) ->
629  AxisMeaning(l, r, Batched.stretched(l, r, Nat.is_eq(U32.to_nat(l), U32.to_nat(r)), Nat.is_eq(U32.to_nat(l), 1n), Nat.is_eq(U32.to_nat(r), 1n))):
630  match decision:
631    case Shape.BTrue{+equal}:
632      %equal : AxisMeaning(l, r, Batched.stretched(l, r, _, Nat.is_eq(U32.to_nat(l), 1n), Nat.is_eq(U32.to_nat(r), 1n)))
633      same_extent(U32.to_nat(l), U32.to_nat(r), Lifecycle.natural_equal(U32.to_nat(l), U32.to_nat(r), equal),
634        Shape.bool_case(Nat.is_eq(U32.to_nat(l), 1n)))
635    case Shape.BFalse{equal}:
636      %equal : AxisMeaning(l, r, Batched.stretched(l, r, _, Nat.is_eq(U32.to_nat(l), 1n), Nat.is_eq(U32.to_nat(r), 1n)))
637      axis_left(l, r, Shape.bool_case(Nat.is_eq(U32.to_nat(l), 1n)))

Uses (10)

Used by (1)