shift

tfsnippet.ops.shift(input, shift, name=None)

Shift each axis of input according to shift, but keep identical size. The extra content will be discarded if shifted outside the original size. Zeros will be padded to the front or end of shifted axes.

Parameters:
  • input (Tensor) – The tensor to be shifted.
  • shift (Iterable[int]) – The shift length for each axes. It must be equal to the rank of input. For each axis, if its corresponding shift < 0, then the input will be shifted to left by -shift at that axis. If its shift > 0, then the input will be shifted to right by shift at that axis.
  • name (str) – Default name of the name scope. If not specified, generate one according to the method name.
Returns:

The output tensor.

Return type:

tf.Tensor