def as_floatX(variable):
 if isinstance(variable, float):
  return numpy.cast[theano.config.floatX](variable)
 if isinstance(variable, numpy.ndarray):
  return numpy.cast[theano.config.floatX](variable)
 return theano.tensor.cast(variable, theano.config.floatX)

def as_floatX ( variable ) : if isinstance ( variable , float ) : return numpy . cast [ theano . config . floatX ] ( variable ) if isinstance ( variable , numpy . ndarray ) : return numpy . cast [ theano . config . floatX ] ( variable ) return theano . tensor . cast ( variable , theano . config . floatX )
casts a given variable into dtype config .