code: def test_binary_connect_affine_forward_backward(
      seed,
      base_axis,
      weight_shape,
      bias,
      quantize_zero_to,
      ctx,
      func_name,
  ):
      from nbla_test_utils import function_tester
  
      rng = np.random.RandomState(seed)
      # Input
      inputs = [rng.randn(2, 3, 4).astype(np.float32)]
      # Weights
      inputs += [rng.randn(*weight_shape).astype(np.float32)]
      # Binary Weights (initialized to zero)
      inputs += [np.zeros(weight_shape).astype(np.float32)]
      # Bias
      if bias:
          inputs += [rng.randn(*weight_shape[1:]).astype(np.float32)]
      else:
          inputs += [None]
  
      insert_identity = [True, True, False, True]
      function_tester(
          rng,
          F.binary_connect_affine,
          ref_binary_connect_affine,
          inputs,
          func_args=[base_axis, quantize_zero_to],
          atol_b=1e-2,
          backward=[True, True, False, True],
          ctx=ctx,
          func_name=func_name,
          ref_grad=ref_grad_binary_connect_affine,
          insert_identity=insert_identity,
      )
  
file_path: nnabla/python/test/function/test_binary_connect_affine.py
imports: import pytest
  import numpy
  import nnabla.functions
  from nbla_test_utils import list_context
label_desc: Use image node_id 4 for calling a global function with example usage: test_binary_connect_affine_forward_backward(seed, base_axis, weight_shape, bias, quantize_zero_to, ctx, func_name) without return types