8000 [Feature] Elementwise operator complex_tensor.normalize() · Issue #38074 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[Feature] Elementwise operator complex_tensor.normalize() #38074

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

Closed
zasdfgbnm opened this issue May 7, 2020 · 3 comments
Closed

[Feature] Elementwise operator complex_tensor.normalize() #38074

zasdfgbnm opened this issue May 7, 2020 · 3 comments
Labels
module: complex Related to complex number support in PyTorch triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@zasdfgbnm
Copy link
Collaborator
zasdfgbnm commented May 7, 2020

🚀 Feature

This elementwise operator converts each complex number R * exp(i * theta) to exp(i * theta).

I am just feeling that having this operator will be convenient, and it is easy to implement such an operator using TensorIterator, and it could be implemented much faster than t / t.abs() on CUDA (native implementation of normalize has 1 memory read, 1 memory write, while t/t.abs() has 3 memory reads and 2 memory writes).

cc @ezyang @anjali411 @dylanbespalko

@zasdfgbnm zasdfgbnm added the module: complex Related to complex number support in PyTorch label May 7, 2020
@vadimkantorov
Copy link
Contributor

A naming consideration: if ever F.normalize gets moved to core ops (and even if not), there may be confusion

@glaringlee glaringlee added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label May 8, 2020
@anjali411
Copy link
Contributor

Hey @zasdfgbnm great point! We discussed to add this feature as torch.sgn

@zasdfgbnm
Copy link
Collaborator Author

Closing this because there is already a discussion about torch.sgn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: complex Related to complex number support in PyTorch triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

4 participants
0