2016-07-15 111 views

回答

1

如何像:

import base64 

def base64_decode_op(x): 
    return tf.py_func(lambda x: base64.decodestring(x), [x], [tf.string])[0] 

sess = tf.InteractiveSession() 
a = base64.encodestring("abcd") 
base64_decode_op(a).eval() 
# prints 'abcd'