def strides

bendtorch-core@0.1.0.0 · src/tensor/permute_build.bend:66

import bendtorch-core@0.1.0.0/src/tensor/permute_build.bend as PermuteBuild
import 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)

Uses (3)

Used by (4)