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

[Cleanup] Change Byte to Bool for training masks #954

Merged
merged 4 commits into from
Oct 29, 2019

Conversation

JakeStevens
Copy link
Contributor

@JakeStevens JakeStevens commented Oct 25, 2019

Description

Using ByteTensor for indexing has been deprecated in PyTorch, leading to many warnings in the example traning scripts. I've updated these to use BoolTensor.

Checklist

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [$CATEGORY] (such as [NN], [Model], [Doc], [Feature]])
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage
  • Code is well-documented
  • To the my best knowledge, examples are either not affected by this change,
    or have been fixed to be compatible with this change
  • Related issue is referred in this PR

@yzh119
Copy link
Member

yzh119 commented Oct 26, 2019

Thanks for your contribution!
Could you please also mention the minimum version number of PyTorch that supports BoolTensor in the README file of these examples? Because users who did not upgrade their PyTorch would receive errors after your changes.

@JakeStevens
Copy link
Contributor Author

I've added a check instead, so that if the version of torch being used has BoolTensors, they are used, thus avoiding the warning. Otherwise, ByteTensor is used as in the original code. This way, users who did not upgrade will not get errors since the code is unchanged for them.

@jermainewang jermainewang mentioned this pull request Oct 28, 2019
32 tasks
@jermainewang
Copy link
Member

Thanks @JakeStevens for the contribution.

@jermainewang jermainewang merged commit 98c1448 into dmlc:master Oct 29, 2019
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