Skip to content

added logical not operator for ByteTensor#1403

Merged
soumith merged 4 commits intopytorch:masterfrom
tejaskhot:logical_not
Apr 30, 2017
Merged

added logical not operator for ByteTensor#1403
soumith merged 4 commits intopytorch:masterfrom
tejaskhot:logical_not

Conversation

@tejaskhot
Copy link
Contributor

fixes #1371


invert_result = ~x
for idx in iter_indices(x):
self.assertIs(1 - x[idx], invert_result[idx])

This comment was marked as off-topic.

torch/tensor.py Outdated
return self.copy_((self + other).eq(1))

def __invert__(self):
if (type(self).__name__ != 'ByteTensor'):

This comment was marked as off-topic.

@apaszke
Copy link
Contributor

apaszke commented Apr 29, 2017

@pytorchbot test this please

@soumith soumith merged commit 0160438 into pytorch:master Apr 30, 2017
@soumith
Copy link
Collaborator

soumith commented Apr 30, 2017

thanks Tejas!

Jiaming-Liu pushed a commit to Jiaming-Liu/pytorch that referenced this pull request May 18, 2017
hubertlu-tw pushed a commit to hubertlu-tw/pytorch that referenced this pull request Nov 1, 2022
…r of the default which should be nvfuser. Modify test scripts to activate fusion. (pytorch#1403)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support ~ operator on ByteTensor

4 participants