class_docstr: This op computes the dot product of specified pieces of vectors
  and matrices, returning pieces of vectors::
  
      for b in range(batch_size):
          for j in range(o.shape[1]):
              for i in range(h.shape[1]):
                  o[b, j, :] += numpy.dot(h[b, i], W[iIdx[b, i], oIdx[b, j]])
  
  where b, h, W, o iIdx, oIdx are defined in the docstring of make_node.
  
  .. image:: ../../../images/blocksparse.png
      :scale: 50 %
class_docstr_tok: ["This","op","computes","the","dot","product","of","specified","pieces","of","vectors","and","matrices",",","returning","pieces","of","vectors",":",":","for","b","in","range","(","batch_size",")",":","for","j","in","range","(","o.shape","[","1","]",")",":","for","i","in","range","(","h.shape","[","1","]",")",":","o","[","b",",","j",",",":","]","+=","numpy.dot","(","h","[","b",",","i","]",",","W","[","iIdx","[","b",",","i","]",",","oIdx","[","b",",","j","]","]",")","where","b",",","h",",","W",",","o","iIdx",",","oIdx","are","defined","in","the","docstring","of","make_node",".","..","image",":",":","..","\/","..","\/","..","\/images\/blocksparse.png",":","scale",":","50","%"]
docstr: Compute the dot product of the specified pieces of vectors
  and matrices.
  
  The parameter types are actually their expected shapes
  relative to each other.
  
  Parameters
  ----------
  o : batch, oWin, oSize
      output vector
  W : iBlocks, oBlocks, iSize, oSize
      weight matrix
  h : batch, iWin, iSize
      input from lower layer (sparse)
  inputIdx : batch, iWin
      indexes of the input blocks
  outputIdx : batch, oWin
      indexes of the output blocks
  
  Returns
  -------
  (batch, oWin, oSize)
      dot(W[i, j], h[i]) + o[j]
  
  Notes
  -----
  - `batch` is the number of examples in a minibatch (batch size).
  - `iBlocks` is the total number of blocks in the input (from lower
      layer).
  - `iSize` is the size of each of these input blocks.
  - `iWin` is the number of blocks that will be used as inputs. Which
     blocks will be used is specified in `inputIdx`.
  - `oBlocks` is the number or possible output blocks.
  - `oSize` is the size of each of these output blocks.
  - `oWin` is the number of output blocks that will actually be computed.
      Which blocks will be computed is specified in `outputIdx`.
docstr_tok: ["Compute","the","dot","product","of","the","specified","pieces","of","vectors","and","matrices",".","The","parameter","types","are","actually","their","expected","shapes","relative","to","each","other",".","Parameters","--","--","--","--","--","o",":","batch",",","oWin",",","oSize","output","vector","W",":","iBlocks",",","oBlocks",",","iSize",",","oSize","weight","matrix","h",":","batch",",","iWin",",","iSize","input","from","lower","layer","(","sparse",")","inputIdx",":","batch",",","iWin","indexes","of","the","input","blocks","outputIdx",":","batch",",","oWin","indexes","of","the","output","blocks","Returns","--","--","--","-","(","batch",",","oWin",",","oSize",")","dot","(","W","[","i",",","j","]",",","h","[","i","]",")","+","o","[","j","]","Notes","--","--","-","-","`","batch","`","is","the","number","of","examples","in","a","minibatch","(","batch","size",")",".","-","`","iBlocks","`","is","the","total","number","of","blocks","in","the","input","(","from","lower","layer",")",".","-","`","iSize","`","is","the","size","of","each","of","these","input","blocks",".","-","`","iWin","`","is","the","number","of","blocks","that","will","be","used","as","inputs",".","Which","blocks","will","be","used","is","specified","in","`","inputIdx","`",".","-","`","oBlocks","`","is","the","number","or","possible","output","blocks",".","-","`","oSize","`","is","the","size","of","each","of","these","output","blocks",".","-","`","oWin","`","is","the","number","of","output","blocks","that","will","actually","be","computed",".","Which","blocks","will","be","computed","is","specified","in","`","outputIdx","`","."]
code: def make_node(self, o, W, h, inputIdx, outputIdx):
      """
      Compute the dot product of the specified pieces of vectors
      and matrices.
  
      The parameter types are actually their expected shapes
      relative to each other.
  
      Parameters
      ----------
      o : batch, oWin, oSize
          output vector
      W : iBlocks, oBlocks, iSize, oSize
          weight matrix
      h : batch, iWin, iSize
          input from lower layer (sparse)
      inputIdx : batch, iWin
          indexes of the input blocks
      outputIdx : batch, oWin
          indexes of the output blocks
  
      Returns
      -------
      (batch, oWin, oSize)
          dot(W[i, j], h[i]) + o[j]
  
      Notes
      -----
      - `batch` is the number of examples in a minibatch (batch size).
      - `iBlocks` is the total number of blocks in the input (from lower
          layer).
      - `iSize` is the size of each of these input blocks.
      - `iWin` is the number of blocks that will be used as inputs. Which
         blocks will be used is specified in `inputIdx`.
      - `oBlocks` is the number or possible output blocks.
      - `oSize` is the size of each of these output blocks.
      - `oWin` is the number of output blocks that will actually be computed.
          Which blocks will be computed is specified in `outputIdx`.
  
      """
      o = theano.tensor.as_tensor_variable(o)
      W = theano.tensor.as_tensor_variable(W)
      h = theano.tensor.as_tensor_variable(h)
      inputIdx = theano.tensor.as_tensor_variable(inputIdx)
      outputIdx = theano.tensor.as_tensor_variable(outputIdx)
  
      if o.ndim != 3:
          raise TypeError("The output o must be a 2D tensor")
      if W.ndim != 4:
          raise TypeError("The weight matrix W must be a 4D tensor")
      if h.ndim != 3:
          raise TypeError("The input h must be a 3D tensor")
      if inputIdx.ndim != 2:
          raise TypeError(
              "The input indices inputIdx must be a 2D tensor"
          )
      if outputIdx.ndim != 2:
          raise TypeError(
              "The output indices outputIdx must be a 2D tensor"
          )
  
      assert inputIdx.type.dtype in discrete_dtypes
      assert outputIdx.type.dtype in discrete_dtypes
  
      return Apply(self, [o, W, h, inputIdx, outputIdx], [o.type()])
  
file_path: Theano/theano/tensor/nnet/blocksparse.py
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import theano
  from theano import Op, Apply
  from theano.tensor import discrete_dtypes
  from theano.gradient import grad_undefined
label_desc: Use image node_id 2 for calling the SparseBlockGemv obj's underlying member method code with example usage: obj.make_node(o, W, h, inputIdx, outputIdx) and returns: Apply