code: def np_conv(na, nw, padding, stride=1):
      batch, in_channel, in_height, in_width = na.shape
      _, num_filter, kernel_h, kernel_w = nw.shape
      if isinstance(stride, int):
          stride_h = stride_w = stride
      else:
          stride_h, stride_w = stride
  
      pad_top, pad_left, pad_bottom, pad_right = get_pad_tuple(
          padding, (kernel_h, kernel_w)
      )
      pad_h = pad_top + pad_bottom
      pad_w = pad_left + pad_right
  
      out_channel = num_filter
      out_height = (in_height - kernel_h + pad_h) // stride_h + 1
      out_width = (in_width - kernel_w + pad_w) // stride_w + 1
      nb = np.zeros((batch, out_channel, out_height, out_width))
      for n in range(batch):
          for f in range(out_channel):
              for c in range(in_channel):
                  if pad_h > 0 or pad_w > 0:
                      apad = np.zeros(
                          (in_height + pad_h, in_width + pad_w)
                      )
                      apad[
                          pad_top : pad_top + in_height,
                          pad_left : pad_left + in_width,
                      ] = na[n, c]
                  else:
                      apad = na[n, c]
                  out = scipy.signal.convolve2d(
                      apad, np.rot90(np.rot90(nw[f, c])), mode="valid"
                  )
                  nb[n, f] += out[::stride, ::stride]
      return nb
  
file_path: tvm/tests/python/contrib/test_nnpack.py
imports: import tvm
  import tvm.testing
  from tvm import te
  import numpy
  import scipy.signal
  from tvm.topi.nn.utils import get_pad_tuple
  from tvm.contrib import nnpack
  import pytest
label_desc: Use image node_id 2 for calling a global function with example usage: np_conv(na, nw, padding, stride) and returns: nb