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

Change nn.dropout to layer.Dropout in TFBart #9047

Merged
merged 1 commit into from
Dec 11, 2020

Conversation

astariul
Copy link
Contributor

What does this PR do?

This PR changes all the tf.nn.dropout calls in modeling_tf_bart.py and use tf.keras.layers.Dropout instead.
More consistent with modeling_tf_roberta.py

Fixes #9045

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

@patrickvonplaten

@patrickvonplaten
Copy link
Contributor

Hey @astariul-colanim

Thanks for the fix! Looks good to me if it solves the error on TPU. Also cc @jplu

Copy link
Contributor

@jplu jplu left a comment

Choose a reason for hiding this comment

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

Thanks!!

LGTM!

Copy link
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

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

Awesome, I checked and TFBart is the only model that made use of tf.nn.dropout so after this PR it'll be more consistent again. Thanks a lot!

Merging to avoid too many conflicts with TFBart refactor: #9029

@sgugger @LysandreJik -> we should make sure to always use tf.keras.layers.Dropout then and not tf.nn.dropout

@patrickvonplaten patrickvonplaten merged commit 935e346 into huggingface:master Dec 11, 2020
@astariul astariul deleted the patch-1 branch December 11, 2020 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 [TF_BART] "<internal expr>" has dtype float32 in the TRUE branch, but dtype=int32 in the FALSE branch
3 participants