code: def _set_initial_values(result, type_and_name, d):
      result.names.append(type_and_name[1])
      vtype = ""
      dim = 0
      if not type_and_name[0]:
          # Infer modal type from tensor shape
          if len(d.shape) == 2:
              # csv for matrix
              vtype = ".csv"
              dim = 1
          elif len(d.shape) == 3:
              # png for 1 map or 3 maps tensor
              vtype = ".png"
              dim = (
                  1
                  if d.shape[0] == 1 or d.shape[0] == 3
                  else d.shape[0]
              )
          else:
              # col for others
              vtype = "col"
              dim = np.prod(d.shape)
      result.types.append(vtype)
      result.dims.append(dim)
      return result
  
imports: import csv
  import os
  import nnabla.utils.callback
  import nnabla.utils.load
  import numpy
  from nnabla.logger import logger
  from nnabla.utils.cli.utility import let_data_to_variable, is_float, compute_full_path
  from nnabla.utils.data_iterator import data_iterator_cache
  from nnabla.utils.data_iterator import data_iterator_csv_dataset
  from nnabla.utils.data_source_loader import FileReader
  from nnabla.utils.image_utils import imsave
  from nnabla.utils.progress import configure_progress, progress
  from six.moves import map
label_desc: Use image node_id 1 for calling a global function with example usage: _set_initial_values(result, type_and_name, d) and returns: result