Add complex32 dtype support to CPU/GPU implementation of (#45339)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/45339
Test Plan:
Imported from OSS
GPU implementation already works as-is:
$ python -c "import torch; a = torch.tensor([1j], dtype=torch.complex32, device=torch.device('cuda')); b = a.clone(); print(b); print(a)"
tensor([0.+1.j], device='cuda:0', dtype=torch.complex32)
tensor([0.+1.j], device='cuda:0', dtype=torch.complex32)
Test for CPU implementation:
$ python -c "import torch; a = torch.tensor([1j], dtype=torch.complex32); b = a.clone(); print(b); print(a)"
tensor([0.+1.j], dtype=torch.complex32)
tensor([0.+1.j], dtype=torch.complex32)
Reviewed By: malfet
Differential Revision: D23932649
Pulled By: soulitzer
fbshipit-source-id: 394b6e1f3d462ee8a010f56f4bb8404af92a066b