Set difference1d tensor#9
Open
rishabh-mondal wants to merge 6 commits intosustainability-lab:mainfrom
Open
Conversation
Member
|
This PR should change only |
Author
|
PR is updated please check. |
Member
|
@rishabh-mondal Rename the function to exactly match with numpy function. Add tests where you use numpy inbuilt function and verify that your function produces the same output. Please add runtime information in this PR as well. |
Member
|
@rishabh-mondal, can you please do what is needed for this PR? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Return the elements in
athat are not in `b'a = torch.tensor([1, 2, 3, 4, 5])
b = torch.tensor([3, 4, 6, 7, 8])
result =([1,2,5])
mask = ~a.unsqueeze(1).eq(b).any(dim=1)
Creates a Boolean mask to identify elements in a that are not present in b.
torch.masked_select(a, mask)
torch.masked_select function to select elements from tensor 'a' based on the Boolean mask.