cupy.roll

cupy.roll(a, shift, axis=None)[source]

Roll array elements along a given axis.

Parameters:
  • a (ndarray) – Array to be rolled.
  • shift (int) – The number of places by which elements are shifted.
  • axis (int or None) – The axis along which elements are shifted. If axis is None, the array is flattened before shifting, and after that it is reshaped to the original shape.
Returns:

Output array.

Return type:

ndarray

See also

numpy.roll()