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)))

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 .