code: def _save_image(
      image, filename, nrow=8, padding=2, square_image=True
  ):
      """Saves a given Tensor into an image file. If the input tensor contains multiple images,
      a grid of images will be saved.
  
      Parameters
      ----------
          image : `NDArray`
              Input image(s) in the format of HW, CHW, or NCHW.
          filename : str
              Filename of the saved image(s).
          nrow : int
              Number of images displayed in each row of the grid. The Final grid size is
              (batch_size / `nrow`, `nrow`) when square_image is False; otherwise, (`nrow`, `nrow`).
          padding : int
              Padding value for each image in the grid.
          square_image : bool
              If True, force the image grid to be strictly square.
      """
      if not isinstance(image, NDArray):
          raise TypeError(
              "MXNet NDArray expected, received {}".format(
                  str(type(image))
              )
          )
      image = _prepare_image(
          image, nrow=nrow, padding=padding, square_image=square_image
      )
      if Image is None:
          raise ImportError(
              "saving image failed because PIL is not found"
          )
      im = Image.fromarray(image.asnumpy())
      im.save(filename)
  
file_path: mxboard/python/mxboard/utils.py
imports: from __future__ import absolute_import
  import os
  import logging
  import numpy
  from mxnet.ndarray import NDArray, op
  from mxnet.ndarray import ndarray
  from mxnet.context import current_context
label_desc: Use image node_id 5 for calling a global function with example usage: _save_image(image, filename, nrow, padding, square_image) without return types