code: def roll(
      x: Tensor, shift: list[int], shift_dims: list[int]
  ) -> Tensor:
      """
      Similar to np.roll but applies to PyTorch Tensors
  
      Args:
          x: input data (k-space or image) that can be
              1) real-valued: the shape is (C,H,W) for 2D spatial inputs and (C,H,W,D) for 3D, or
              2) complex-valued: the shape is (C,H,W,2) for 2D spatial data and (C,H,W,D,2) for 3D. C is the number of channels.
          shift: the amount of shift along each of shift_dims dimensions
          shift_dims: dimensions over which the shift is applied
  
      Returns:
          shifted version of x
  
      Note:
          This function is called when fftshift and ifftshift are not available in the running pytorch version
      """
      if len(shift) != len(shift_dims):
          raise ValueError(
              f"len(shift) != len(shift_dims), got f{len(shift)} and f{len(shift_dims)}."
          )
      for s, d in zip(shift, shift_dims):
          x = roll_1d(x, s, d)
      return x
  
file_path: MONAI/monai/networks/blocks/fft_utils_t.py
imports: from __future__ import annotations
  import torch
  from torch import Tensor
label_desc: Use image node_id 2 for calling a global function with example usage: roll(x, shift, shift_dims) and returns: x