aesara.tensor.roll

Contents

aesara.tensor.roll#

aesara.tensor.roll(x, shift, axis=None)[source]#

Convenience function to roll TensorTypes along the given axis.

Syntax copies numpy.roll function.

Parameters:
  • x (tensor_like) – Input tensor.

  • shift (int (symbolic or literal)) – The number of places by which elements are shifted.

  • axis (int (symbolic or literal), optional) – The axis along which elements are shifted. By default, the array is flattened before shifting, after which the original shape is restored.

Returns:

Output tensor, with the same shape as x.

Return type:

tensor