code: def test_channel_first(
      ctx, func_name, seed, test, graph_ref, graph_act
  ):
      from .graph_converter_test_utils import (
          structure_tester,
          value_tester,
      )
  
      if not func_name.endswith("Cudnn"):
          pytest.skip(
              "ChannelFirst/Last conversion is only supported in cuDNN context."
          )
  
      with nn.context_scope(ctx):
          # Random number
          np.random.seed(seed)
          rng = np.random.RandomState(seed)
  
          # Graph
          x_data = rng.randn(batch_size, 32, 32, 3)
          x = nn.Variable.from_numpy_array(x_data)
  
          y_tgt = graph_act(x, test=test)
  
          # FunctionModifier
          modifiers = []
          inputs = [x]
          outputs = [y_tgt]
          modifiers.append(GC.ChannelFirstModifier(inputs))
  
          y_act = GC.GraphConverter(modifiers).convert(outputs)
  
          # Ref Graph
          x_data_cf = rng.randn(batch_size, 3, 32, 32)
          x_cf = nn.Variable.from_numpy_array(x_data_cf)
  
          y_ref = graph_ref(x_cf, test=test)
  
          # Test
          structure_tester(y_ref, y_act[0])
          value_tester(y_tgt, y_act[0], rtol=6e-02, atol=5e-02)
  
file_path: nnabla/python/test/utils/test_graph_converters/test_channel_first.py
imports: from __future__ import absolute_import
  import pytest
  import numpy
  import nnabla
  import nnabla.experimental.graph_converters
  from nnabla.ext_utils import get_extension_context
  from .ref_graphs.resnets import small_cl_resnet, small_bn_resnet
  from nbla_test_utils import list_context
label_desc: Use image node_id 1 for calling a global function with example usage: test_channel_first(ctx, func_name, seed, test, graph_ref, graph_act) without return types