code: def run_gradweight(
      self, inputs_shape, filters_shape, dCdH_shape, subsample=(1, 1)
  ):
      inputs_shape = [inputs_shape[i] for i in (0, 3, 1, 2)]
      filters_shape = [filters_shape[i] for i in (0, 3, 1, 2)]
      dCdH_shape = [dCdH_shape[i] for i in (0, 3, 1, 2)]
  
      inputs_val = np.random.random(inputs_shape).astype(config.floatX)
      dCdH_val = np.random.random(dCdH_shape).astype(config.floatX)
      inputs = gpuarray_shared_constructor(inputs_val)
      dCdH = gpuarray_shared_constructor(dCdH_val)
      shape = gpuarray_shared_constructor(np.array(filters_shape[2:]))
  
      if subsample == (1, 1):
          conv_ref = CorrMM_gradWeights(subsample=subsample)(
              ref_cast(inputs), ref_cast(dCdH)
          )
          conv_gemm = GpuCorrMM_gradWeights(subsample=subsample)(
              inputs, dCdH
          )
      else:
          conv_ref = CorrMM_gradWeights(subsample=subsample)(
              ref_cast(inputs), ref_cast(dCdH), shape=shape
          )
          conv_gemm = GpuCorrMM_gradWeights(subsample=subsample)(
              inputs, dCdH, shape=shape
          )
  
      f_ref = theano.function([], conv_ref, mode=mode_without_gpu)
      f = theano.function([], conv_gemm, mode=mode_with_gpu)
  
      res_ref = f_ref()
      res = f()
      utt.assert_allclose(res_ref, res)
  
imports: from __future__ import absolute_import, print_function, division
  import unittest
  import numpy
  import theano
  from theano import config
  from theano.tests import unittest_tools
  from theano.tensor.nnet.corr import CorrMM, CorrMM_gradWeights, CorrMM_gradInputs
  from ..type import gpuarray_shared_constructor
  from ..blas import GpuCorrMM, GpuCorrMM_gradWeights, GpuCorrMM_gradInputs
  from .config import mode_with_gpu, mode_without_gpu, ref_cast
  from theano.tensor.nnet.tests.test_abstract_conv import Grouped_conv_noOptim, TestUnsharedConv
  from theano.tensor.nnet.tests.test_abstract_conv import TestAsymmetricPadding, TestCausalConv
label_desc: Use image node_id 7 for calling the TestCorrMM obj's underlying member method code with example usage: obj.run_gradweight(inputs_shape, filters_shape, dCdH_shape, subsample) without return types