

def make_node(self, x, index):
    x = as_sparse_variable(x)
    assert (x.format in ['csr', 'csc'])
    assert (len(index) == 2)
    input_op = [x]
    for ind in index:
        if isinstance(ind, slice):
            raise Exception('GetItemScalar called with a slice as index!')
        elif isinstance(ind, int):
            ind = theano.tensor.constant(ind)
            input_op += [ind]
        elif (ind.ndim == 0):
            input_op += [ind]
        else:
            raise NotImplemented()
    return gof.Apply(self, input_op, [tensor.scalar(dtype=x.dtype)])

dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/sparse/basic.py GetItemScalar.make_node/original