def floatX(num): if theano.config.floatX == 'float32': return np.float32(num) else: raise Exception("{} type not supported".format(theano.config.floatX))