roll(input, shifts, dims=None)
Roll the input tensor along the given dimension(s). Elements that are shifted beyond the last position are re-introduced at the first position. If a dimension is not specified, the tensor will be flattened before rolling and then restored to the original shape.
input (Variable) – The input tensor variable.
shifts (int|list|tuple) – The number of places by which the elements of the input tensor are shifted.
dims (int|list|tuple|None) – Dimentions along which to roll.
A Tensor with same data type as input.
- Return type