class_docstr: Base class for `Corr3dMM`, `Corr3dMM_gradWeights` and
  `Corr3dMM_gradInputs`. Cannot be used directly.
  
  Every sub-class must define internal attribute ``_direction`` out of __init__().
  ``_direction`` must take one of following values:
  
   - "forward" to correlate bottom with weights and store results in top.
   - "backprop weights" to do a valid convolution of bottom with top
     (swapping the first two dimensions) and store results in weights.
   - "backprop inputs" to do a full convolution of top with weights
     (swapping the first two dimensions) and store results in bottom.
  
  Parameters
  ----------
  border_mode : {'valid', 'full', 'half'}
      Additionally, the padding size could be directly specified by an integer
      or a tuple of three of integers
  subsample
      Perform subsampling of the output (default: (1, 1, 1)).
  filter_dilation
      Perform dilated correlation (default: (1, 1, 1))
  num_groups
      Perform grouped convolutions (default: 1)
class_docstr_tok: ["Base","class","for","`","Corr3dMM","`",",","`","Corr3dMM_gradWeights","`","and","`","Corr3dMM_gradInputs","`",".","Can","not","be","used","directly",".","Every","sub-class","must","define","internal","attribute","``","_direction","``","out","of","__init__","(",")",".","``","_direction","``","must","take","one","of","following","values",":","-","``","forward","''","to","correlate","bottom","with","weights","and","store","results","in","top",".","-","``","backprop","weights","''","to","do","a","valid","convolution","of","bottom","with","top","(","swapping","the","first","two","dimensions",")","and","store","results","in","weights",".","-","``","backprop","inputs","''","to","do","a","full","convolution","of","top","with","weights","(","swapping","the","first","two","dimensions",")","and","store","results","in","bottom",".","Parameters","--","--","--","--","--","border_mode",":","{","'valid","'",",","'full","'",",","'half","'","}","Additionally",",","the","padding","size","could","be","directly","specified","by","an","integer","or","a","tuple","of","three","of","integers","subsample","Perform","subsampling","of","the","output","(","default",":","(","1",",","1",",","1",")",")",".","filter_dilation","Perform","dilated","correlation","(","default",":","(","1",",","1",",","1",")",")","num_groups","Perform","grouped","convolutions","(","default",":","1",")"]
code: def __init__(
      self,
      border_mode="valid",
      subsample=(1, 1, 1),
      filter_dilation=(1, 1, 1),
      openmp=None,
      num_groups=1,
  ):
      super(BaseCorr3dMM, self).__init__(openmp=openmp)
      if isinstance(border_mode, integer_types):
          if border_mode < 0:
              raise ValueError(
                  "invalid border_mode {}, which must be a "
                  "non-negative integer".format(border_mode)
              )
          border_mode = (border_mode, border_mode, border_mode)
      if isinstance(border_mode, tuple):
          if len(border_mode) != 3 or min(border_mode) < 0:
              raise ValueError(
                  "invalid border_mode {}, which must be a tuple of "
                  "three non-negative integers".format(border_mode)
              )
          pad_h, pad_w, pad_d = map(int, border_mode)
          border_mode = (pad_h, pad_w, pad_d)
      if not (
          (isinstance(border_mode, tuple) and min(border_mode) >= 0)
          or border_mode in ("valid", "full", "half")
      ):
          raise ValueError(
              "invalid border_mode {}, which must be either "
              '"valid", "full", "half", an integer or a tuple of three'
              " integers".format(border_mode)
          )
      self.border_mode = border_mode
      if len(subsample) != 3:
          raise ValueError("subsample must have three elements")
      if len(filter_dilation) != 3:
          raise ValueError("filter_dilation must have three elements")
      self.subsample = tuple(subsample)
      self.filter_dilation = tuple(filter_dilation)
      if num_groups < 1:
          raise ValueError("Number of groups should be greater than 0")
      self.num_groups = num_groups
  
      if not theano.config.blas.ldflags:
          # Theano will use a NumPy C implementation of [sd]gemm_ instead.
          self.blas_type = ""
      else:
          if "openblas" in theano.config.blas.ldflags:
              self.blas_type = "openblas"
          elif "mkl" in theano.config.blas.ldflags:
              self.blas_type = "mkl"
          else:
              self.blas_type = ""
  
      if self._direction not in [
          "forward",
          "backprop weights",
          "backprop inputs",
      ]:
          raise ValueError(
              "_direction must be one of 'forward', "
              "'backprop weights', 'backprop inputs'"
          )
  
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
  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 1 to create a new BaseCorr3dMM object from inherited base classes: gof with example: obj = BaseCorr3dMM(border_mode, subsample, filter_dilation, openmp, num_groups)