code: def compare_with_cpu_command(args):
      configure_progress(os.path.join(args.outdir, "progress.txt"))
  
      class TrainConfig:
          pass
  
      class OptConfig:
          pass
  
      class MonConfig:
          pass
  
      # Load config with current context
      files = []
      files.append(args.config)
  
      with nn.parameter_scope("current"):
          info = load.load(files)
          parameters = get_parameters(grad_only=False)
  
      config = TrainConfig()
      config.global_config = info.global_config
      config.training_config = info.training_config
  
      config.optimizers = OrderedDict()
      for name, opt in info.optimizers.items():
          o = OptConfig()
          o.optimizer = opt
          o.data_iterator = None
          config.optimizers[name] = o
  
      config.monitors = OrderedDict()
      for name, mon in info.monitors.items():
          m = MonConfig()
          m.monitor = mon
          m.data_iterator = None
          config.monitors[name] = m
  
      # Load config with cpu context
      files = []
      files.append(args.config2)
  
      with nn.parameter_scope("cpu"):
          info_cpu = load.load(files)
          cpu_parameters = get_parameters(grad_only=False)
  
      config_cpu = TrainConfig()
      config_cpu.global_config = info_cpu.global_config
      config_cpu.training_config = info_cpu.training_config
  
      config_cpu.optimizers = OrderedDict()
      for name, opt in info_cpu.optimizers.items():
          o = OptConfig()
          o.optimizer = opt
          o.data_iterator = None
          config_cpu.optimizers[name] = o
  
      config_cpu.monitors = OrderedDict()
      for name, mon in info_cpu.monitors.items():
          m = MonConfig()
          m.monitor = mon
          m.data_iterator = None
          config_cpu.monitors[name] = m
  
      result_array = [["1-Correl"]]
  
      # Profile Optimizer
      with ExitStack() as stack:
          for name, o in config.optimizers.items():
              o.data_iterator = stack.enter_context(
                  o.optimizer.data_iterator()
              )
          for name, o in config_cpu.optimizers.items():
              o.data_iterator = stack.enter_context(
                  o.optimizer.data_iterator()
              )
          result_array = compare_optimizer(
              config,
              parameters,
              config_cpu,
              cpu_parameters,
              result_array,
          )
  
      # Write profiling result
      import csv
  
      with open(
          args.outdir + os.sep + "compare_with_cpu.csv", "w"
      ) as f:
          writer = csv.writer(f, lineterminator="\n")
          writer.writerows(result_array)
  
      logger.log(99, "Compare with CPU Completed.")
      progress(None)
      return True
  
file_path: nnabla/python/src/nnabla/utils/cli/compare_with_cpu.py
imports: import os
  from collections import OrderedDict
  import nnabla
  import nnabla.utils.load
  import numpy
  from contextlib2 import ExitStack
  from nnabla.logger import logger
  from nnabla.parameter import get_parameters
  from nnabla.utils.cli.utility import let_data_to_variable
  from nnabla.utils.progress import configure_progress, progress
label_desc: Use image node_id 4 for calling a global function with example usage: compare_with_cpu_command(args) and returns: True