标签:constant print asp with 2.3 efault 3.3 utf-8 flow
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
@author: myhaspl
@email:myhaspl@myhaspl.com
"""
import tensorflow as tf
g=tf.Graph()
with g.as_default():
x=tf.constant([[4.00, 3.33], [2.34, 7.00]])
y=tf.cast(tf.equal(tf.cast(tf.cast(x,tf.int32),tf.float32),x),tf.int32)
with tf.Session(graph=g) as sess:
print sess.run(y)
[[1 0]
[0 1]]
标签:constant print asp with 2.3 efault 3.3 utf-8 flow
原文地址:http://blog.51cto.com/13959448/2315921