Skip to content

Conversation

@colesbury
Copy link
Member

@colesbury colesbury commented Dec 7, 2017

The C/C++ unary negation operator is well defined for unsigned types. We
should use that behavior. This also implements neg for CharTensor. That
behavior currently depends on whether char is signed or unsigned.

Fixes #4066, #3225

The C/C++ unary negation operator is well defined for unsigned types. We
should use that behavior. This also implements neg for CharTensor. That
behavior currently depends on whether char is signed or unsigned.

Fixes pytorch#4066
@pytorchbot
Copy link
Collaborator

@colesbury, thanks for your PR! We identified @zdevito to be a potential reviewer.

@staticmethod
def _test_neg(self, cast):
float_types = ['torch.DoubleTensor', 'torch.FloatTensor', 'torch.LongTensor']
int_types = ['torch.IntTensor', 'torch.ShortTensor']

This comment was marked as off-topic.

This comment was marked as off-topic.

Copy link
Contributor

@gchanan gchanan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

@pietern
Copy link
Contributor

pietern commented Dec 7, 2017

There was some CI maintenance happening this morning -- retriggering build.

@pytorchbot retest this please

@colesbury colesbury merged commit 9ea576d into pytorch:master Dec 7, 2017
@colesbury colesbury deleted the neg branch December 7, 2017 21:37
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.

4 participants