class_docstr: Gradient wrt. filters for `CorrMM`.
  
  Notes
  -----
  You will not want to use this directly, but rely on
  Theano's automatic differentiation or graph optimization to
  use it as needed.
class_docstr_tok: ["Gradient","wrt",".","filters","for","`","CorrMM","`",".","Notes","--","--","-","You","will","not","want","to","use","this","directly",",","but","rely","on","Theano","'s","automatic","differentiation","or","graph","optimization","to","use","it","as","needed","."]
code: def infer_shape(self, node, input_shape):
      if self.border_mode == "half":
          padH_l = padH_r = padW_l = padW_r = -1
      elif self.border_mode == "full":
          padH_l = padH_r = padW_l = padW_r = -2
      elif isinstance(self.border_mode, tuple):
          border = ()
          for mode in self.border_mode:
              if isinstance(mode, tuple):
                  border += ((int(mode[0]), int(mode[1])),)
              else:
                  border += ((int(mode), int(mode)),)
          (padH_l, padH_r), (padW_l, padW_r) = border
      else:
          assert self.border_mode == "valid"
          padH_l = padH_r = padW_l = padW_r = 0
      dH, dW = self.subsample
      imshp = input_shape[0]
      topshp = input_shape[1]
      ssize, imshp = imshp[1], list(imshp[2:])
      ssize = ssize // self.num_groups
      nkern, topshp = topshp[1], list(topshp[2:])
      height_width = node.inputs[-2:]
      if (dH != 1) or (padH_l == -1) or (padH_r == -1):
          # vertical subsampling or half padding, kernel height is specified
          kH = height_width[0]
      elif (padH_l == -2) or (padH_r == -2):
          # vertical full padding, we can infer the kernel height
          kH = 2 - imshp[0] + (topshp[0] - 1) * dH
      else:
          # explicit padding, we can infer the kernel height
          kH = imshp[0] + padH_l + padH_r - (topshp[0] - 1) * dH
      if (dW != 1) or (padW_l == -1) or (padW_r == -1):
          kW = height_width[1]
      elif (padW_l == -2) or (padW_r == -2):
          kW = 2 - imshp[1] + (topshp[1] - 1) * dW
      else:
          kW = imshp[1] + padW_l + padW_r - (topshp[1] - 1) * dW
      if self.unshared is True:
          return [(nkern, topshp[0], topshp[1], ssize, kH, kW)]
      else:
          return [(nkern, ssize, kH, kW)]
  
imports: from __future__ import absolute_import, print_function, division
  import os
  import logging
  from six import integer_types
  import theano
  from theano import Apply
  from theano import gof
  from theano.gof import ParamsType, EnumList
  from theano.scalar import int64, int8
  from theano.tensor import as_tensor_variable, TensorType
  from theano.tensor.nnet.abstract_conv import get_conv_output_shape
  from theano.tensor import blas_headers
  from theano.tensor.blas import ldflags, blas_header_version
label_desc: Use image node_id 2 for calling the CorrMM_gradWeights obj's underlying member method code with example usage: obj.infer_shape(node, input_shape) and returns: list, list