Skip to content
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

Fix two testing functions and move out tf.test #1678

Merged
merged 2 commits into from
Apr 16, 2020

Conversation

autoih
Copy link
Member

@autoih autoih commented Apr 16, 2020

Copy link
Member

@gabrieldemarmiesse gabrieldemarmiesse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the pull request. Just a few questions to better understand why some changes were made.

tensorflow_addons/seq2seq/tests/basic_decoder_test.py Outdated Show resolved Hide resolved
tensorflow_addons/seq2seq/tests/basic_decoder_test.py Outdated Show resolved Hide resolved
tensorflow_addons/seq2seq/tests/basic_decoder_test.py Outdated Show resolved Hide resolved
@gabrieldemarmiesse
Copy link
Member

gabrieldemarmiesse commented Apr 16, 2020

Ok I found the reason. When calling self.evaluate(...) on the dictionary to get eval_result, all the values in the dictionary become numpy arrays (not TF tensors). Since here we're not calling evaluate, we end up with tensorflow tensors in the dictionary. As such, the same functions cannot be called. A cleaner change would be to call .numpy() when creating the eval_result dictionary, then we wouldn't need to do that cast, gather and such. Could you make that change?

@autoih
Copy link
Member Author

autoih commented Apr 16, 2020

Thanks @gabrieldemarmiesse. It looks cleaner instead of simply convert.

Copy link
Member

@gabrieldemarmiesse gabrieldemarmiesse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@gabrieldemarmiesse gabrieldemarmiesse merged commit 34037b3 into tensorflow:master Apr 16, 2020
@autoih autoih deleted the ptb2 branch April 16, 2020 18:47
jrruijli pushed a commit to jrruijli/addons that referenced this pull request Dec 23, 2020
* Fix two testing functions and move out tf.test

* conversion removal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants