10000 Ensure conj_physical always does a physical conjugation · pytorch/pytorch@e1fe699 · GitHub
[go: up one dir, main page]

Skip to content

Commit e1fe699

Browse files
committed
Ensure conj_physical always does a physical conjugation
When the argument tensor has a conj bit set. The conj_physical implementation will do `arg.conj().clone()`. Which is not a physical conjugation but a reversal of the conjugate view state. Instead we should unconditionally perform the conjugation of the underling data data, and ensure the argument conjugate bit is propagated to the result. ghstack-source-id: 2408bd2 Pull Request resolved: #149226
1 parent f2221b2 commit e1fe699

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

aten/src/ATen/native/UnaryOps.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -617,10 +617,8 @@ Tensor& conj_physical_out(const Tensor& self, Tensor& result) {
617617
}
618618

619619
Tensor _conj_physical(const Tensor& self) {
620-
if (self.is_conj()) {
621-
return self.conj().clone();
622-
}
623620
auto result = at::empty_like(self);
621+
result._set_conj(self.is_conj());
624622
return at::conj_physical_out(result, self);
625623
}
626624

0 commit comments

Comments
 (0)
0