You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
_unsafe_view returns copy if self has conjugate bit set #60478
high prioritymodule: complexRelated to complex number support in PyTorchtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
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} ]
high prioritymodule: complexRelated to complex number support in PyTorchtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Activity
soulitzer commentedon Jun 22, 2021
cc @ngimel @albanD
albanD commentedon Jun 22, 2021
Adding high priority because _unsafe_view is used quite a bit to implement other ops, so that might break important ops.
anjali411 commentedon Jun 24, 2021
There's an easy fix for this one! we can add
_unsafe_viewto the fallthrough list here:pytorch/aten/src/ATen/ConjugateFallback.cpp
Line 121 in bdb964f
are there other ops similar to
_unsafe_viewthat are views but their schema has no alias infos?albanD commentedon Jun 24, 2021
Not that I'm aware of no.
Update base for Update on "Add neg bit "
Update on "Add neg bit "
Update base for Update on "Add neg bit "
Update on "Add neg bit "
Update base for Update on "Add neg bit "
Update on "Add neg bit "
3 remaining items
Update on "Add neg bit "
Update base for Update on "Add neg bit "
Update on "Add neg bit "
Update base for Update on "Add neg bit "
Update on "Add neg bit "
Update base for Update on "Add neg bit "
Update on "Add neg bit "
Update base for Update on "Add neg bit "
Update on "Add neg bit "
Update base for Update on "Add neg bit "
Update on "Add neg bit "
Update base for Update on "Add neg bit "
Update on "Add neg bit "
Add neg bit (pytorch#56058)