def resized
import bendtorch-core@0.1.0.0/src/tensor/slice.bend as Sliceimport Base
122# The input dimensions with the extent at the axis replaced.
123def resized(dimensions: List<&2, U32>, +dim: Nat, +extent: U32) -> List<&2, U32>:
124 match dimensions dim:
125 case head <> rest 0n:
126 extent <> rest
127 case head <> rest 1n+next:
128 head <> resized(rest, next, extent)
129 case Nil{} _:
130 Nil{}