code: def test_spectral_norm_forward_backward(
      seed, output_u, test, eps, itr, w_shape, dim, ctx, func_name
  ):
      from nbla_test_utils import function_tester
  
      rng = np.random.RandomState(seed)
  
      w = rng.randn(*w_shape).astype(np.float32)
      u = rng.randn(*(w_shape[dim],)).astype(np.float32)
      inputs = [w, u]
  
      backward = [False, False] if test else [True, False]
      ref_grad = (
          ref_grad_spectral_norm
          if output_u
          else ref_grad_spectral_norm_no_output_u
      )
  
      function_tester(
          rng,
          F.spectral_norm,
          ref_spectral_norm,
          inputs,
          func_args=[dim, itr, eps, test, output_u],
          backward=backward,
          ref_grad=ref_grad,
          atol_accum=3e-2,
          ctx=ctx,
          func_name=func_name,
      )
  
file_path: nnabla/python/test/function/test_spectral_norm.py
imports: import pytest
  import numpy
  import nnabla
  import nnabla.functions
  import nnabla.parametric_functions
  from nbla_test_utils import list_context
label_desc: Use image node_id 4 for calling a global function with example usage: test_spectral_norm_forward_backward(seed, output_u, test, eps, itr, w_shape, dim, ctx, func_name) without return types