Skip to content

Conversation

@xuhdev
Copy link
Collaborator

@xuhdev xuhdev commented Nov 11, 2019

Per @ailzhang's suggestion in #28162 (comment), this PR changes the implementation of binary comparison and logical ops
to those of unary ops in UnaryOps.cpp. The reason is that the call should eventually go through
at::op_out (e.g., at::logical_xor_out).

The check for Boolean output tensor is also removed, because:

  • This check should only apply to _out functions but not on other variants. However, other variants
    must go through the _out variant eventually.
  • It does not have a clear motivation and seems unnecessary.

Copy link
Contributor

@ailzhang ailzhang left a comment

Choose a reason for hiding this comment

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

I had two inline questions but overall looks good to me! :D

Per @ailzhang's suggestion, this PR changes the implementation of binary comparison and logical ops
to those of unary ops in UnaryOps.cpp. The reason is that the call should eventually go through
at::op_out (e.g., at::logical_xor_out).

The check for Boolean output tensor is also removed, because:

- This check should only apply to _out functions but not on other variants. However, other variants
  must go through the _out variant eventually.
- It does not have a clear motivation and seems unnecessary.
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@ailzhang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@ailzhang
Copy link
Contributor

ailzhang commented Nov 13, 2019

All tests passed, landing.
update: land failed due to internal failure, will try again tmr.

@facebook-github-bot
Copy link
Contributor

@ailzhang merged this pull request in 3a72662.

zdevito pushed a commit to zdevito/ATen that referenced this pull request Nov 13, 2019
Summary:
Per ailzhang's suggestion in pytorch/pytorch#28162 (comment), this PR changes the implementation of binary comparison and logical ops
to those of unary ops in UnaryOps.cpp. The reason is that the call should eventually go through
at::op_out (e.g., at::logical_xor_out).

The check for Boolean output tensor is also removed, because:

- This check should only apply to _out functions but not on other variants. However, other variants
  must go through the _out variant eventually.
- It does not have a clear motivation and seems unnecessary.
Pull Request resolved: pytorch/pytorch#29591

Differential Revision: D18460113

Pulled By: ailzhang

fbshipit-source-id: 58d501e59335186b3b8cc7d80ee9eed74efeeac8
xuhdev added a commit to xuhdev/pytorch-xla that referenced this pull request Nov 13, 2019
@xuhdev xuhdev deleted the comp-op branch November 13, 2019 19:35
@xuhdev
Copy link
Collaborator Author

xuhdev commented Nov 13, 2019

Thanks!

xuhdev added a commit to xuhdev/pytorch-xla that referenced this pull request Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants