

def perform(self, node, inp, out_):
    (out_shape, values, ilist) = inp
    (out,) = out_
    (rows, cols) = values.shape
    assert (rows == len(ilist))
    indptr = (numpy.arange((cols + 1)) * rows)
    indices = as_strided(ilist, strides=(0, ilist.strides[0]), shape=(cols, ilist.shape[0])).flatten()
    data = values.T.flatten()
    out[0] = scipy.sparse.csc_matrix((data, indices, indptr), shape=out_shape, dtype=values.dtype)

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