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

Use boolean mask to avoid deprecated usage #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

soraxas
Copy link

@soraxas soraxas commented Jul 12, 2021

The usage of byte tensor to index torch tensor is deprecated, and will constantly output warnings on every forward pass (e.g., see this)

Example output from running the bnaf.py (the only file that had this deprecated usage):

 [W IndexingUtils.h:30] Warning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.(function expandTensors)
 [W IndexingUtils.h:30] Warning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.(function expandTensors)
 [W IndexingUtils.h:30] Warning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.(function expandTensors)
 [W IndexingUtils.h:30] Warning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.(function expandTensors)
 Start step 0; Training for 10000 steps:   0 % | | 47 / 10000[00:00 < 03:19, 49.78 it / s
 [W IndexingUtils.h: 30] Warning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.(function expandTensors)
 [W IndexingUtils.h:30] Warning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.(function expandTensors)
 [W IndexingUtils.h:30] Warning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.(function expandTensors)
 [W IndexingUtils.h:30] Warning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.(function expandTensors)
 [W IndexingUtils.h:30] Warning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.(function expandTensors)
 Start step 0; Training for 10000 steps:   0 % | | 48 / 10000[00:00 < 03:19, 49.78 it / s
 [W IndexingUtils.h: 30] Warning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.(function expandTensors)
 ...

This PR switch it to a bool tensor instead.

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.

1 participant