fn
unfold_dim_op
→TensorImplPtrint unfold_dim_op(const int & a, int dim, int size, int step)Sliding-window view of a along a single dimension.
Shape
Adds a trailing size-sized axis; the original dim is replaced
by the number of windows L.
Parameters
aTensorImplPtrInput tensor.
dimintAxis along which to unfold.
sizeintWindow width.
stepintStride between successive windows.
Returns
TensorImplPtrTensor whose shape is (*in_shape[:dim], L, *in_shape[dim+1:], size) where .
Notes
Behaves as a view; backward passes through a gather that
accumulates overlapping windows back into the input.