

def perform(self, node, inp, out_):
    (x, y) = inp
    (out,) = out_
    rval = x.dot(y)
    if (not scipy.sparse.issparse(rval)):
        rval = getattr(scipy.sparse, (x.format + '_matrix'))(rval)
    if (rval.dtype.num != numpy.dtype(str(rval.dtype)).num):
        assert (str(rval.dtype) == node.outputs[0].dtype)
        format = node.outputs[0].type.format
        data = rval.data.view(dtype=node.outputs[0].dtype)
        indices = rval.indices
        indptr = rval.indptr
        shape = rval.shape
        if (format == 'csc'):
            rval = scipy.sparse.csc_matrix((data, indices, indptr), shape, copy=False)
        else:
            assert (format == 'csr')
            rval = scipy.sparse.csr_matrix((data, indices, indptr), shape, copy=False)
    out[0] = rval

dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/sparse/basic.py TrueDot.perform/original