Skip to content

Conversation

@Rocketknight1
Copy link
Member

In our TF examples, we use return_tensors="tf" for the data collators. However, prepare_tf_dataset and to_tf_dataset actually use a NumPy loader internally, which we wrap with a tf.data.Dataset at the end. As a result, return_tensors="np" works much better for them, and avoids some weird slowdown bugs we've experienced.

This PR replaces every instance in our notebooks with return_tensors="np", and adds some explanatory text above. (cc @gante, @amyeroberts, @sayakpaul just so you're aware)

@Rocketknight1 Rocketknight1 requested a review from sgugger January 23, 2023 17:18
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Contributor

@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.

Thanks!

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.

3 participants