code: def unravel_index(index: int, shape: torch.Tensor):
      """
      Unravel the index input to fit the given shape.
      This function is needed for torch.jit.script compatibility.
  
      Args:
          index (int): The index to unravel.
          shape (Tesnor): The shape to unravel the index to.
  
      Returns:
          Tensor: The unraveled index.
      """
      out = []
      shape = torch.flip(shape, dims=(0,))
      for dim in shape:
          out.append(index % dim)
          index = index // dim
      out = torch.tensor([int(x.item()) for x in out])
      return torch.flip(out, dims=(0,))
  
file_path: NeMo/nemo/collections/asr/parts/utils/optimization_utils.py
imports: import torch
label_desc: Use image node_id 1 for calling a global function with example usage: unravel_index(index, shape) and returns: torch