code: def unravel_index(index, shape):
      out = []
      for dim in reversed(shape):
          out.append(index % dim)
          index = index // dim
      return torch.stack(tuple(reversed(out)), dim=-1)
  
imports: from typing import Dict, Optional
  import torch
  import torch.nn
  from torch import Tensor
label_desc: Use image node_id 1 for calling a global function with example usage: unravel_index(index, shape) and returns: torch