code: def depthwise_conv2d_backward_weight_nhwc(
      Input, Out_grad, oshape, fshape, stride, padding
  ):
      """Depthwise convolution nhwc backward wrt weight operator.
  
      Parameters
      ----------
      Input : tvm.te.Tensor
          4-D with shape [batch, in_height, in_width, in_channel]
  
      Out_grad : tvm.te.Tensor
          4-D with shape [batch, out_height, out_width, out_channel]
  
      stride : tuple of two ints
          The spatial stride along height and width
  
      padding : int or str
          Padding size, or ['VALID', 'SAME']
  
      Returns
      -------
      Output : tvm.te.Tensor
          4-D with shape [filter_height, filter_width, in_channel, channel_multiplier]
      """
      batch, out_h, out_w, out_c = oshape
      filter_h, filter_w, _, channel_multiplier = fshape
      in_c = Input.shape[3].value
      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, (filter_h, filter_w)
      )
  
      padded_in = pad(
          Input,
          [0, pad_top, pad_left, 0],
          [0, pad_bottom, pad_right, 0],
          name="padded_in",
      )
  
      dh = te.reduce_axis((0, Out_grad.shape[1].value), name="dh")
      dw = te.reduce_axis((0, Out_grad.shape[2].value), name="dw")
      db = te.reduce_axis((0, batch), name="db")
      idxdiv = tvm.tir.indexdiv
      idxmod = tvm.tir.indexmod
  
      Weight_grad = te.compute(
          (filter_h, filter_w, in_c, channel_multiplier),
          lambda fh, fw, c, m: te.sum(
              Out_grad[
                  db,
                  dh,
                  dw,
                  c * channel_multiplier
                  + idxmod(m, channel_multiplier),
              ]
              * padded_in[
                  db, fh + dh * stride_h, fw + dw * stride_w, c
              ],
              axis=[db, dh, dw],
          ),
          tag="depthwise_conv2d_backward_weight_nhwc",
      )
  
      return Weight_grad
  
file_path: tvm/python/tvm/topi/nn/depthwise_conv2d.py
imports: from __future__ import absolute_import
  from collections import namedtuple
  import numpy
  import tvm
  from tvm import te
  from .dilate import dilate
  from .pad import pad
  from .utils import get_pad_tuple
  from ..utils import simplify, get_const_tuple
label_desc: Use image node_id 5 for calling a global function with example usage: depthwise_conv2d_backward_weight_nhwc(Input, Out_grad, oshape, fshape, stride, padding) and returns: Weight_grad