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

fixed a minor bug: assign values to a sliced tensor #17

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

Conversation

NOTGOOOOD
Copy link

In PyTorch, it is not possible to directly assign values to a sliced tensor.

It means that line 57-64 in '/models/gt_matches_generation.py' will not work.

Such as:
gt_matches0[cross_check_consistent0][symmetric_dist_ori > positive_threshold] = IGNORE_INDEX

To solve this, I would suggest doing like the following:

gt_matches0_check = gt_matches0[cross_check_consistent0].clone()
gt_matches0_check[symmetric_dist_0 > positive_threshold] = IGNORE_INDEX
gt_matches0.masked_scatter_(cross_check_consistent0, gt_matches0_check)

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