code: def convolution_inference(
      data,
      kernel,
      bias,
      padding,
      stride,
      nthreads=1,
      algorithm=ConvolutionAlgorithm.AUTO,
  ):
      """Create an extern op to do inference convolution of 4D tensor data and
      4D tensor kernel and 1D tensor bias with nnpack.
  
      Parameters
      ----------
      data : Tensor
          data 4D tensor input[batch][input_channels][input_height][input_width] of
          FP32 elements.
      kernel : Tensor
          kernel 4D tensor kernel[output_channels][input_channels][kernel_height]
          [kernel_width] of FP32 elements.
      bias : Tensor
          bias 1D array bias[output_channels][input_channels][kernel_height]
          [kernel_width] of FP32 elements.
      padding : list
          padding A 4-dim list of [pad_top, pad_bottom, pad_left, pad_right],
          which indicates the padding around the feature map.
      stride : list
          stride A 2-dim list of [stride_height, stride_width], which indicates
          the stride.
  
      Returns
      -------
      output : Tensor
          output 4D tensor output[batch][output_channels][output_height][output_width]
          of FP32 elements.
      """
  
      assert isinstance(padding, list) and len(padding) == 4
      assert isinstance(stride, list) and len(stride) == 2
      batch, _, input_height, input_width = data.shape
      output_channels, _, kernel_height, kernel_width = kernel.shape
      idxdiv = te.indexdiv
      output_height = (
          idxdiv(
              input_height + padding[0] + padding[1] - kernel_height,
              stride[0],
          )
          + 1
      )
      output_width = (
          idxdiv(
              input_width + padding[0] + padding[1] - kernel_width,
              stride[1],
          )
          + 1
      )
  
      return te.extern(
          (batch, output_channels, output_height, output_width),
          [data, kernel, bias] if bias is not None else [data, kernel],
          lambda ins, outs: tvm.tir.call_packed(
              "tvm.contrib.nnpack.convolution_inference",
              ins[0],
              ins[1],
              ins[2] if bias is not None else 0,
              outs[0],
              padding[0],
              padding[1],
              padding[2],
              padding[3],
              stride[0],
              stride[1],
              nthreads,
              algorithm,
          ),
          name="C",
      )
  
file_path: tvm/python/tvm/contrib/nnpack.py
imports: import tvm
  from tvm import te
  import tvm._ffi
label_desc: Use image node_id 3 for calling a global function with example usage: convolution_inference(data, kernel, bias, padding, stride, nthreads, algorithm) and returns: te