pytorch rolling window

Solutions on MaxInterview for pytorch rolling window by the best coders in the world

showing results for - "pytorch rolling window"
Lydia
14 Mar 2016
1import torch
2
3x = torch.arange(10)#tensor([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9])
4x.unfold(0,4,3) #Tensor.unfold(dimension, window_size, step) 
5
6'''tensor([[0, 1, 2, 3],
7        [3, 4, 5, 6],
8        [6, 7, 8, 9]])'''