def decode
import bendtorch-core@0.1.0.0/src/shape/LAWS.bend as LAWSimport Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
67def decode(+dims: List<&2, Nat>, +values: List<&2, Nat>) -> Maybe<&2, Shape.Coordinate(dims)>:
68 match dims values:
69 case Nil{} Nil{}:
70 Some{Unit{}}
71 case +dh <> +dt +vh <> +vt:
72 decode.step(dh, dt, decode(dt, vt), fin_of(dh, vh))
73 case Nil{} vh <> vt:
74 None{}
75 case dh <> dt Nil{}:
76 None{}
Uses (7)
Used by (18)
- bendtorch-core@0.1.0.0/src/shape/boundary_proofs:decode_fit
- bendtorch-core@0.1.0.0/src/shape/boundary_proofs:decode_rank
- bendtorch-core@0.1.0.0/src/shape/boundary_proofs:decode_unfit
- bendtorch-core@0.1.0.0/src/shape/boundary_proofs:flatten_checked
- bendtorch-core@0.1.0.0/src/tensor/matrix_index_proof:flat_pair
- …