def floatX(X):
 try:
  return X.astype(theano.config.floatX)
 except AttributeError:
  return np.asarray(X, dtype=theano.config.floatX)

def floatX ( X ) : try : return X . astype ( theano . config . floatX ) except AttributeError : return np . asarray ( X , dtype = theano . config . floatX )
convert a theano tensor or numpy array to theano .