code: def test_no_grad(auto_forward):
      import nnabla as nn
      import nnabla.functions as F
      import nnabla.parametric_functions as PF
  
      nn.clear_parameters()
  
      def network(x):
          def conv_bn_relu(h, i, name, skip=True):
              s = h
              imaps = h.shape[1]
              with nn.parameter_scope(name):
                  h = PF.convolution(h, imaps, (3, 3), pad=(1, 1))
                  h = PF.batch_normalization(h)
                  h = F.relu(h)
              if not skip:
                  return (
                      F.concatenate(*[h, s], axis=1)
                      if i % 2 == 0
                      else h + s
                  )
  
              h = F.split(h, axis=1)
              h = [
                  h_.reshape(h_.shape[:1] + (1,) + h_.shape[1:])
                  for h_ in h
              ]
              h = F.concatenate(*h, axis=1)
              return h
  
          h = x
          h = conv_bn_relu(h, 0, "first-conv", False)
          for i in range(10):
              h = conv_bn_relu(h, i, f"{i:00d}-conv")
          pred = F.tanh(h)
          return pred
  
      def assert_need_grad_flase(f):
          for inp in f.inputs:
              assert inp.need_grad == False, "need_grad must be false"
          for out in f.outputs:
              assert out.need_grad == False, "need_grad must be false"
  
      x = (
          nn.Variable.from_numpy_array(np.random.randn(4, 16, 32, 32))
          .apply(need_grad=False)
          .apply(persistent=True)
      )
      with nn.auto_forward(auto_forward):
          y0 = network(x)
          y0.forward(
              clear_no_need_grad=True
          ) if not auto_forward else None
      with nn.auto_forward(auto_forward), nn.no_grad():
          y1 = network(x)
          y1.forward(
              clear_no_need_grad=True
          ) if not auto_forward else None
  
      y1.visit(assert_need_grad_flase)
      np.testing.assert_allclose(y0.d, y1.d)
  
file_path: nnabla/python/test/test_parameter.py
imports: from six import iterkeys
  import pytest
  import numpy
  import nnabla.parametric_functions
  from nnabla.initializer import UniformInitializer
label_desc: Use image node_id 8 for calling a global function with example usage: test_no_grad(auto_forward) and returns: pred, h, unknown