code: def save_image(path, data, mode=None):
      """Save image.
  
      The input image is expected to be CHW order
      """
      if torch.is_tensor(data):
          data = data.numpy()
      if mode == "L" and data.ndim == 3:
          assert data.shape[0] == 1
          data = data[0]
      if data.ndim == 3:
          data = data.transpose(1, 2, 0)
      Image.fromarray(data, mode=mode).save(path)
  
imports: import torch
  from torchaudio._internal.module_utils import is_module_available
label_desc: Use image node_id 1 for calling a global function with example usage: save_image(path, data, mode) without return types