def sparse_block_dot(W, h, inputIdx, b, outputIdx):
    assert inputIdx.ndim == h.ndim - 1
    assert outputIdx.ndim == inputIdx.ndim
    if h.ndim == 2:
        h = h.dimshuffle('x', 0, 1)
        inputIdx = inputIdx.dimshuffle('x', 0)
        outputIdx = outputIdx.dimshuffle('x', 0)
    return SparseBlockGemv()(b.take(outputIdx, axis=0), W, h,
                             inputIdx, outputIdx)
Compute the dot product (plus bias) of the specified pieces of vectors
dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/tensor/nnet/blocksparse.py/sparse_block_dot