class_docstr: Gradient wrt. filters for `CorrMM`.
  
  Notes
  -----
  You will not want to use this directly, but rely on
  PyTensor's automatic differentiation or graph optimization to
  use it as needed.
code: def grad(self, inp, grads):
      bottom, top = inp[:2]
      (weights,) = grads
      d_bottom = CorrMM_gradInputs(
          self.border_mode,
          self.subsample,
          self.filter_dilation,
          self.num_groups,
          self.unshared,
      )(weights, top, bottom.shape[-2:])
      d_top = CorrMM(
          self.border_mode,
          self.subsample,
          self.filter_dilation,
          self.num_groups,
          self.unshared,
      )(bottom, weights)
      d_height_width = (
          (pytensor.gradient.DisconnectedType()(),) * 2
          if len(inp) == 4
          else ()
      )
      return (d_bottom, d_top) + d_height_width
  
imports: import logging
  import os
  from typing import Optional
  import pytensor
  from pytensor.configdefaults import config
  from pytensor.graph.basic import Apply
  from pytensor.graph.op import _NoPythonOp
  from pytensor.link.c.op import OpenMPOp
  from pytensor.link.c.params_type import ParamsType
  from pytensor.link.c.type import EnumList
  from pytensor.scalar import int8, int64
  from pytensor.tensor import blas_headers
  from pytensor.tensor.basic import as_tensor_variable
  from pytensor.tensor.blas import blas_header_version, ldflags
  from pytensor.tensor.conv.abstract_conv import get_conv_output_shape
  from pytensor.tensor.type import TensorType
label_desc: Use image node_id 4 for calling the CorrMM_gradWeights obj's underlying member method code with example usage: obj.grad(inp, grads) and returns: unknown