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 dtype conversion of example_input_array in model summary #2510

Merged
merged 2 commits into from
Jul 5, 2020

Conversation

awaelchli
Copy link
Contributor

@awaelchli awaelchli commented Jul 5, 2020

What does this PR do?

Fixes #2286

We currently convert the input to model.dtype. We should however not do this and let the user determine the dtype, since there are models that have different dtype for their inputs than for the model parameters. Example: nn.Embedding layer takes a long tensor as input, but the weights are float.

Therefore, the fix is to simply drop the automatic conversion.

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together? Otherwise, we ask you to create a separate PR for every change.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@mergify mergify bot requested a review from a team July 5, 2020 07:01
@awaelchli awaelchli added the bug Something isn't working label Jul 5, 2020
@awaelchli awaelchli changed the title fix dtype conversion fix dtype conversion of example_input_array in model summary Jul 5, 2020
@codecov
Copy link

codecov bot commented Jul 5, 2020

Codecov Report

Merging #2510 into master will increase coverage by 2%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master   #2510    +/-   ##
=======================================
+ Coverage      88%     90%    +2%     
=======================================
  Files          69      69            
  Lines        5611    5610     -1     
=======================================
+ Hits         4946    5060   +114     
+ Misses        665     550   -115     

@awaelchli awaelchli marked this pull request as ready for review July 5, 2020 07:10
@williamFalcon williamFalcon merged commit 6bfcfa8 into master Jul 5, 2020
@awaelchli awaelchli deleted the bugfix/example_input_dtype branch July 6, 2020 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

example_input_array dtype
2 participants