code: def test_binary_weight_convolution_2d_forward_backward(
      inshape,
      kernel,
      outmaps,
      pad,
      stride,
      dilation,
      group,
      with_bias,
      quantize_zero_to,
      seed,
      ctx,
      func_name,
  ):
      from nbla_test_utils import function_tester
  
      rng = np.random.RandomState(seed)
      i = rng.randn(*inshape).astype(np.float32)
      inmaps = inshape[-3]
      kshape = (outmaps,) + (inmaps // group,) + kernel
      k = rng.randn(*kshape).astype(np.float32)
      base_axis = len(inshape) - 3
      b = None
      if with_bias:
          b = rng.randn(outmaps).astype(np.float32)
      inputs = [i, k, np.zeros_like(k), np.zeros(outmaps), b]
      function_tester(
          rng,
          F.binary_weight_convolution,
          ref_binary_weight_convolution,
          inputs,
          func_args=[
              base_axis,
              pad,
              stride,
              dilation,
              group,
              quantize_zero_to,
          ],
          atol_f=1e-4,
          atol_b=3e-3,
          atol_accum=1e-5,
          dstep=1e-2,
          backward=[True, True, False, False, True],
          ctx=ctx,
          func_name=func_name,
          ref_grad=ref_grad_binary_weight_convolution,
      )
  
file_path: nnabla/python/test/function/test_binary_weight_convolution.py
imports: from __future__ import division
  import pytest
  import numpy
  import nnabla
  import nnabla.functions
  import refs
  from nbla_test_utils import list_context
label_desc: Use image node_id 5 for calling a global function with example usage: test_binary_weight_convolution_2d_forward_backward(inshape, kernel, outmaps, pad, stride, dilation, group, with_bias, quantize_zero_to, seed, ctx, func_name) without return types