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
I realized that if the _dot function introduced in #21 is wrapped with real, then pullback_function works for complex arrays as well, whenever gradient supports complex inputs for a given backend. But at least in the scalar case, the real dot product can be computed twice as efficiently as real(_dot(x, y)).
The text was updated successfully, but these errors were encountered:
Not certain if this package wants to support complex AD (with Jacobians as the primitive, complex support is a little awkward), but to me it seems like, if the AD supports complex numbers, then at least for pushforwards, pullbacks, and gradients, it'd be nice if we did too.
That's right, and even with both complex inputs and outputs, it can be supported by interleaving the real and imaginary parts into one real vector, but having the eltype be dependent on the real-ness of input and output starts to feel messy.
I realized that if the
_dot
function introduced in #21 is wrapped withreal
, thenpullback_function
works for complex arrays as well, whenevergradient
supports complex inputs for a given backend. But at least in the scalar case, the real dot product can be computed twice as efficiently asreal(_dot(x, y))
.The text was updated successfully, but these errors were encountered: