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 make_node(self, img, topgrad, shape=None):
      img = as_tensor_variable(img)
      topgrad = as_tensor_variable(topgrad)
      img, topgrad = self.as_common_dtype(img, topgrad)
      if img.type.ndim != 4:
          raise TypeError("img must be 4D tensor")
      if topgrad.type.ndim != 4:
          raise TypeError("topgrad must be 4D tensor")
      if shape is None:
          if self.subsample != (1, 1) or self.border_mode == "half":
              raise ValueError(
                  "shape must be given if subsample != (1, 1)"
                  ' or border_mode == "half"'
              )
          height_width = []
      else:
          height_width = [
              as_tensor_variable(shape[0]).astype("int64"),
              as_tensor_variable(shape[1]).astype("int64"),
          ]
  
      if self.unshared is True:
          out_shape = [
              1 if topgrad.type.shape[1] == 1 else None,
              None,
              None,
              1 if img.type.shape[1] == 1 else None,
              None,
              None,
          ]
      else:
          out_shape = [
              1 if topgrad.type.shape[1] == 1 else None,
              1 if img.type.shape[1] == 1 else None,
              None,
              None,
          ]
  
      dtype = img.type.dtype
      return Apply(
          self,
          [img, topgrad] + height_width,
          [TensorType(dtype, shape=out_shape)()],
      )
  
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 1 for calling the CorrMM_gradWeights obj's underlying member method code with example usage: obj.make_node(img, topgrad, shape) and returns: Apply