law matmul_inner_error
import bendtorch-core@0.1.0.0/src/tensor/matmul_LAWS.bend as MatmulLAWSimport Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/matmul.bend as Matrix
249# Two rank-2 operands whose inner extents differ fail with
250# InnerDimensionMismatch, never with a rank or capacity error: [2, 3] @ [4, 2]
251# is an inner mismatch.
252law matmul_inner_error:
253 for +left: Shape.Shape
254 for +right: Shape.Shape
255 for a: Core.Tensor<left>
256 for b: Core.Tensor<right>
257 for +rows: U32
258 for +inner: U32
259 for +right_inner: U32
260 for +columns: U32
261 for left_matrix: {Shape.dimensions(left) == [rows, inner] : List<&2, U32>}
262 for right_matrix: {Shape.dimensions(right) == [right_inner, columns] : List<&2, U32>}
263 for mismatch: {U32.to_nat(inner) != U32.to_nat(right_inner) : Nat}
264 {Matrix.matmul(Core.Packed{left, a}, Core.Packed{right, b}) == Fail{Matrix.InnerDimensionMismatch{}} : Result<&2, &1, Matrix.Error, Core.Dynamic & Core.Dynamic & Core.Dynamic>}
Uses (18)
Used by (0)
No other definition uses this definition.