code: def test_spectral_norm_double_backward(
      seed, output_u, test, eps, itr, w_shape, dim, ctx, func_name
  ):
      from nbla_test_utils import backward_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 = [True, False]
      # We need `skip_backward_check=True` because numerical gradient will not be calculated correctly.
      # This is the same reason written in `ref_grad_spectral_norm`.
      backward_function_tester(
          rng,
          F.spectral_norm,
          inputs=inputs,
          func_args=[dim, itr, eps, test, output_u],
          backward=backward,
          skip_backward_check=True,
          ctx=ctx,
      )
  
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 5 for calling a global function with example usage: test_spectral_norm_double_backward(seed, output_u, test, eps, itr, w_shape, dim, ctx, func_name) without return types