-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Closed
Labels
high prioritymodule: complexRelated to complex number support in PyTorchRelated to complex number support in PyTorchtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
Since _unsafe_view's schema has no alias info, ConjugateFallback considers it an out-of-place operation, so the conjugate is always materialized, producing a copy.
auto a = torch::tensor(1., at::TensorOptions().dtype(at::ScalarType::ComplexDouble)).conj();
auto b = at::_unsafe_view(a, {1});
b += 1;
std::cout << "a: " << a << "b: " << b << std::endl;
Output:
a:
[W Copy.cpp:240] Warning: Casting complex values to real discards the imaginary part (function operator())
1
[ CPUComplexDoubleType{} ]
b:
2
[ CPUComplexDoubleType{1} ]
cc @ezyang @gchanan @zou3519 @bdhirsh @jbschlosser @anjali411 @dylanbespalko @mruberry @lezcano @nikitaved
Metadata
Metadata
Assignees
Labels
high prioritymodule: complexRelated to complex number support in PyTorchRelated to complex number support in PyTorchtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module