code: def test_sparseblockgemv_grad_shape(self):
      b = tensor.fmatrix()
      W = tensor.ftensor4()
      h = tensor.ftensor3()
      iIdx = tensor.imatrix()
      oIdx = tensor.imatrix()
  
      o = self.gemv_op(b.take(oIdx, axis=0), W, h, iIdx, oIdx)
      go = theano.grad(o.sum(), [b, W, h])
  
      f = theano.function([W, h, iIdx, b, oIdx], go, mode=self.mode)
  
      (
          W_val,
          h_val,
          iIdx_val,
          b_val,
          oIdx_val,
      ) = BlockSparse_Gemv_and_Outer.gemv_data()
  
      # just make sure that it runs correcly and all the shapes are ok.
      b_g, W_g, h_g = f(W_val, h_val, iIdx_val, b_val, oIdx_val)
  
      assert b_g.shape == b_val.shape
      assert h_g.shape == h_val.shape
      assert W_g.shape == W_val.shape
  
imports: from __future__ import absolute_import, print_function, division
  import numpy
  from numpy.random import randn
  import theano
  from theano import tensor
  import theano.tests.unittest_tools
  from theano.tensor.nnet.blocksparse import sparse_block_dot, sparse_block_gemv, sparse_block_outer, SparseBlockGemv, SparseBlockOuter
label_desc: Use image node_id 13 for calling the BlockSparse_Gemv_and_Outer obj's underlying member method code with example usage: obj.test_sparseblockgemv_grad_shape() without return types