code: def run_gradinput(
      self, inputs_shape, filters_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)]
  
      inputs_val = np.random.random(inputs_shape).astype(config.floatX)
      filters_val = np.random.random(filters_shape).astype(
          config.floatX
      )
      inputs = gpuarray_shared_constructor(inputs_val)
      filters = gpuarray_shared_constructor(filters_val)
  
      bottom_height = (inputs_shape[2] - 1) * subsample[
          0
      ] + filters_shape[2]
      bottom_width = (inputs_shape[3] - 1) * subsample[
          1
      ] + filters_shape[3]
      bottom_shape = gpuarray_shared_constructor(
          np.array([bottom_height, bottom_width])
      )
  
      if subsample == (1, 1):
          conv_ref = CorrMM_gradInputs(subsample=subsample)(
              kern=ref_cast(filters), topgrad=ref_cast(inputs)
          )
          conv_gemm = GpuCorrMM_gradInputs(subsample=subsample)(
              kern=filters, topgrad=inputs
          )
      else:
          conv_ref = CorrMM_gradInputs(subsample=subsample)(
              kern=ref_cast(filters),
              topgrad=ref_cast(inputs),
              shape=bottom_shape,
          )
          conv_gemm = GpuCorrMM_gradInputs(subsample=subsample)(
              kern=filters, topgrad=inputs, shape=bottom_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 9 for calling the TestCorrMM obj's underlying member method code with example usage: obj.run_gradinput(inputs_shape, filters_shape, subsample) without return types