def mat_or_die
import bendtorch@1.3.0.0/main.bend as Bendtorchimport Base
import bend-ml-tensor-array@0.1.18.0/main.bend as TA
1013def mat_or_die(-r: Nat, -c: Nat, +path: String, m: Maybe<&1, TA.Mat<r, c>>) -> IO(TA.Mat<r, c>):
1014 match m:
1015 case None{}:
1016 IO.die(TA.Mat<r, c>, 1, path ++ ": wrong number of values for this shape")
1017 case Some{x}:
1018 IO.pure(TA.Mat<r, c>, x)