New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tf.while example is not working in eager mode #18257
Comments
Thanks for the report, @akshaym is looking into fixing that. |
This is fixed on TF 1.15 but broken on TF 2.0. |
I can reproduce this on 2.0. @saxenasaurabh can you please help take a look? |
On Colab, TF 2, api: https://www.tensorflow.org/api_docs/python/tf/while_loop Example in api doc:
TF 2 on Eager mode by default: My work-around (wrap in autograph
|
Has this bug been solved? I run tf2.1 and the problem is still there. |
I was able to replicate and resolve this issue in 2.7 |
It turns out this has been causing a headache for me through several versions of TF 2.x. I anxiously await a resolution. |
This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Thank you. |
Closing as stale. Please reopen if you'd like to work on this further. |
Describe the problem
tf.while
example is not working in eager modeSource code / logs
Here is the code
result:
TypeError: Cannot iterate over a scalar tensor.
Reason
b
) returns a single scalar, which code later tries to unpack.Possible solutions:
The text was updated successfully, but these errors were encountered: