code: def test_name_all_variables():
      def net(h):
          import nnabla.functions as F
          import nnabla.parametric_functions as PF
  
          h = PF.convolution(h, 3, (3, 3), name="conv1")
          h = PF.batch_normalization(h, name="bn1")
          h = F.relu(h)
          h = F.max_pooling(h, (2, 2))
          h = PF.convolution(h, 3, (3, 3), name="conv2")
          h = PF.batch_normalization(h, name="bn2")
          pred = F.relu(h)
          return pred
  
      class Namer(object):
          def __init__(
              self,
          ):
              self.counter = 0
  
          def __call__(self, nnabla_func):
              for v in nnabla_func.outputs:
                  v.name = "{}_output_{:05d}".format(
                      nnabla_func.name, self.counter
                  )
                  self.counter += 1
  
      class Confirmer(object):
          def __init__(
              self,
          ):
              self.counter = 0
  
          def __call__(self, nnabla_func):
              for v in nnabla_func.outputs:
                  assert v.name == "{}_output_{:05d}".format(
                      nnabla_func.name, self.counter
                  )
                  self.counter += 1
  
      x = nn.Variable([2, 3, 8, 8])
      pred = net(x)
      pred.visit(Namer())
      pred.forward(clear_no_need_grad=True)
      pred.backward(clear_buffer=True)
      pred.visit(Confirmer())
  
imports: import pytest
  import numpy
  import nnabla
  from nnabla.testing import assert_allclose
label_desc: Use image node_id 10 for calling a global function with example usage: test_name_all_variables() and returns: pred