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

Deprecated warning due to non-BoolTensor mask in apply_circular_mask_to_weights() #20

Open
davidljung opened this issue Jan 17, 2020 · 0 comments

Comments

@davidljung
Copy link

When instantiating the Cortex class, the function apply_circular_mask_to_weights() does:

  tensor = circular_mask(matrix.size()[1], matrix.size()[0], radius, matrix.is_cuda)
  matrix.masked_fill_(tensor, 0)

However, in PyTorch 1.3.1 (and likely some previous versions), calling masked_fill_ with a tensor that isn't a BoolTensor is depreciated.

The warning can be eliminated by changing the line to:

matrix.masked_fill_(tensor.type(torch.BoolTensor), 0)

though a better solution would be to have all the mask functions (like circular_mask()) return BoolTensor 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

No branches or pull requests

1 participant