Skip to content

Use boolean mask to avoid deprecated usage#14

Open
soraxas wants to merge 1 commit intokamenbliznashki:masterfrom
soraxas:master
Open

Use boolean mask to avoid deprecated usage#14
soraxas wants to merge 1 commit intokamenbliznashki:masterfrom
soraxas:master

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.

Signed-off-by: Tin Lai <oscar@tinyiu.com>
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