def as_theano_expression(input):
    if isinstance(input, theano.gof.Variable):
        return input
    else:
        try:
            return theano.tensor.constant(input)
        except Exception as e:
            raise TypeError("Input of type %s is not a Theano expression and "
                            "cannot be wrapped as a Theano constant (original "
                            "exception: %s)" % (type(input), e))
Wrap as Theano expression.
dataset/ETHPy150Open Lasagne/Lasagne/lasagne/utils.py/as_theano_expression