roll¶
-
paddle.fluid.layers.
roll
(input, shifts, dims=None)[source] 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.
- Parameters
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.
- Returns
A Tensor with same data type as input.
- Return type
Variable
Examples