code: def verify_bitserial_conv2d_nchw(
      batch,
      in_size,
      in_channel,
      num_filter,
      kernel,
      stride,
      padding,
      activation_bits,
      weight_bits,
      unipolar,
  ):
      in_height = in_width = in_size
      input_dtype = "uint32"
      out_dtype = "int32"
  
      with tvm.target.Target("llvm"):
          A = te.placeholder(
              (batch, in_channel, in_height, in_width),
              dtype=input_dtype,
              name="A",
          )
          W = te.placeholder(
              (num_filter, in_channel, kernel, kernel),
              dtype=input_dtype,
              name="W",
          )
          B = topi.x86.bitserial_conv2d_nchw(
              A,
              W,
              stride,
              padding,
              activation_bits,
              weight_bits,
              input_dtype,
              out_dtype,
              unipolar,
          )
          s = topi.x86.schedule_bitserial_conv2d_nchw([B])
  
      a_shape = get_const_tuple(A.shape)
      w_shape = get_const_tuple(W.shape)
  
      @memoize("topi.tests.test_topi_bitseral_conv2d_nchw")
      def get_ref_data():
          a_np = generate_quantized_np(
              get_const_tuple(a_shape), activation_bits, input_dtype
          )
          w_np = generate_quantized_np(
              get_const_tuple(w_shape), weight_bits, input_dtype
          )
          if unipolar:
              w_ = np.copy(w_np).astype(out_dtype)
              for x in np.nditer(w_, op_flags=["readwrite"]):
                  x[...] = 1 if x == 1 else -1
              b_np = tvm.topi.testing.conv2d_nchw_python(
                  a_np.astype(out_dtype), w_, stride, padding
              )
          else:
              b_np = tvm.topi.testing.conv2d_nchw_python(
                  a_np, w_np, stride, padding
              )
          return a_np, w_np, b_np
  
      a_np, w_np, b_np = get_ref_data()
  
      dev = tvm.cpu(0)
      a = tvm.nd.array(a_np, dev)
      w = tvm.nd.array(w_np, dev)
      b = tvm.nd.array(
          np.zeros(get_const_tuple(B.shape), dtype=B.dtype), dev
      )
      func = tvm.build(s, [A, W, B], "llvm")
      func(a, w, b)
      tvm.testing.assert_allclose(b.numpy(), b_np, rtol=1e-5)
  
file_path: tvm/tests/python/topi/test_topi_bitserial_conv2d.py
imports: import numpy
  import tvm
  from tvm import te
  from tvm import topi
  import tvm.testing
  import tvm.topi.testing
  from tvm.topi.utils import get_const_tuple
  from tvm.contrib.pickle_memoize import memoize
label_desc: Use image node_id 2 for calling a global function with example usage: verify_bitserial_conv2d_nchw(batch, in_size, in_channel, num_filter, kernel, stride, padding, activation_bits, weight_bits, unipolar) and returns: a_np,  w_np,  b_np