complex -> real casting warning only raised during gradient computation of function using tensordot #18133
Unanswered
DanPuzzuoli
asked this question in
General
Replies: 1 comment
-
Just wanted to draw attention to this again - anyone have any thoughts this? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm running into an issue where a complex -> real casting warning is being raised when computing the gradient of a function, but not when calling the function itself. The function I found this in involves computing
tensordot
on a pair of arrays with one being real and one complex. Below is a minimal example:grad(g)(1.)
works and returns the correct result, however it raises the warning:This warning however is not raised when simply calling
g
, e.g.:In my full case I know one of the arrays is real ahead of time, but the other is user-specified and could be either real or complex. (Of course, in the minimal example, we could have cast the second array as real as the imaginary part is irrelevant to the function output, but in my full code this is only a single piece of a larger, potentially complex-typed computation.)
It seems like this warning should not be raised during gradient computation, but I'm not sure of the latest policy on real/complex type mixing in functions like
tensordot
.Beta Was this translation helpful? Give feedback.
All reactions