code: def roll_1d(x: Tensor, shift: int, shift_dim: int) -> Tensor:
      """
      Similar to roll but for only one dim.
  
      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 dimension
          shift_dim: the dimension over which the shift is applied
  
      Returns:
          1d-shifted version of x
  
      Note:
          This function is called when fftshift and ifftshift are not available in the running pytorch version
      """
      shift = shift % x.size(shift_dim)
      if shift == 0:
          return x
  
      left = x.narrow(shift_dim, 0, x.size(shift_dim) - shift)
      right = x.narrow(shift_dim, x.size(shift_dim) - shift, shift)
  
      return torch.cat((right, left), dim=shift_dim)
  
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 1 for calling a global function with example usage: roll_1d(x, shift, shift_dim) and returns: torch, x