code: def test_no_grad(seed, graph):
      from .graph_converter_test_utils import (
          structure_tester,
          value_tester,
      )
  
      nn.clear_parameters()
  
      # Random number
      np.random.seed(seed)
      rng = np.random.RandomState(seed)
  
      # Graph
      x_data = rng.randn(4, 3, 32, 32)
      x0 = (
          nn.Variable.from_numpy_array(x_data)
          .apply(need_grad=False)
          .apply(persistent=True)
      )
      y0 = graph(x0)
      y1 = y0.no_grad()
  
      # Test
      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"
  
      y1.visit(assert_need_grad_flase)
      structure_tester(y0, y1)
      value_tester(y0, y1, clear_no_need_grad=True)
  
file_path: nnabla/python/test/utils/test_graph_converters/test_no_grad.py
imports: from __future__ import absolute_import
  import pytest
  import numpy
  import nnabla
  import nnabla.experimental.graph_converters
  from .ref_graphs.resnets import small_bn_resnet
  from .ref_graphs.lenets import lenet
label_desc: Use image node_id 1 for calling a global function with example usage: test_no_grad(seed, graph) without return types