if my tensor is [0 ,1]. I want to get "if 1==tensor[1]" is true, want should I do in tensorflow. I have tried tensor.eval() function, it work ,but is not work for all of my project. thanks
Asked
Active
Viewed 3,933 times
1
-
Please add _why_ it is not working in all of your projects. – Chris311 Dec 06 '16 at 08:09
1 Answers
1
You can create a new tensor using tf.Variable(1)
and compare this with the existing tensor using tf.equal()
.
This will return a tensor of type bool. You can print the value of this tensor using tensor.eval()
or tf.Print()
{ using tf.InteractiveSession() } the following way:
How to print the value of a Tensor object in TensorFlow?

Community
- 1
- 1

phoenix007
- 71
- 1
- 6