def strides
import bendtorch-core@0.1.0.0/src/tensor/permute_build.bend as PermuteBuildimport Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
66# The row-major stride of each dimension: the element count after it.
67def strides(+dims: List<&2, Nat>) -> List<&2, Nat>:
68 match dims:
69 case Nil{}:
70 Nil{}
71 case head <> tail:
72 Shape.numel(tail) <> strides(tail)