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 Tensorflow T5 with int64 input #13479

Merged
merged 2 commits into from
Sep 8, 2021
Merged

Fix Tensorflow T5 with int64 input #13479

merged 2 commits into from
Sep 8, 2021

Conversation

Rocketknight1
Copy link
Member

@Rocketknight1 Rocketknight1 commented Sep 8, 2021

Our Tensorflow T5 model uses constant values that are initialized with tf.constant() or just from Python int literals. Tensorflow guesses the dtype in both of these cases as int32, which causes the operations using them to fail if int64 input is supplied.

This PR adds checks that cast the constants to the dtype of the inputs, to ensure that the operations succeed for both int32 and int64 inputs.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for fixing!

Copy link
Member

@LysandreJik LysandreJik 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 fixing @Rocketknight1!

@Rocketknight1 Rocketknight1 merged commit 7071052 into master Sep 8, 2021
@Rocketknight1 Rocketknight1 deleted the t5_int_dtype_fix branch September 8, 2021 14:06
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.

None yet

3 participants