code: def test_profiling():
      batch_size = 16
      n_class = 10
  
      device = "cpu"
      ctx = get_extension_context(device)
      nn.set_default_context(ctx)
  
      x = nn.Variable(shape=(batch_size, 1, 32, 32))
      t = nn.Variable(shape=(batch_size, 1))
  
      y = cnn(x, n_class)
      loss = F.mean(F.softmax_cross_entropy(y, t))
  
      solver = S.Sgd()
      solver.set_parameters(nn.get_parameters())
  
      x.d = np.random.normal(size=x.shape)
      t.d = np.floor(
          np.random.rand(*t.shape) * (n_class - 0.000001)
      ).astype(np.int32)
  
      B = GraphProfiler(
          loss, solver=solver, device_id=0, ext_name=device, n_run=1000
      )
  
      B.run()
  
      csv_writer = GraphProfilerCsvWriter(gb=B, file=sys.stdout)
      csv_writer.write()
  
file_path: nnabla/python/test/utils/test_profiler.py
imports: import sys
  import nnabla
  import nnabla.functions
  import nnabla.parametric_functions
  import nnabla.solver
  import numpy
  from nnabla.ext_utils import get_extension_context
  from nnabla.utils.profiler import GraphProfiler, GraphProfilerCsvWriter
label_desc: Use image node_id 2 for calling a global function with example usage: test_profiling() without return types