#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
@author: myhaspl
@email:[email protected]
"""
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]]
tensorflow-判断tensor是否为小数
猜你喜欢
转载自blog.51cto.com/13959448/2315921
今日推荐
周排行