Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting scale array in adjoint plan application fails for subarrays #112

Open
gaurav-arya opened this issue Jul 19, 2023 · 1 comment

Comments

@gaurav-arya
Copy link
Contributor

gaurav-arya commented Jul 19, 2023

The code convert(typeof(x), scale) fails when x is a subarray, e.g. in line

return p.p \ (x ./ convert(typeof(x), scale))

It would also fail if x is e.g. a Zygote.OneElement, e.g. in the context of the plan reverse rule.


Jax's implementation for reference: https://github.com/google/jax/blob/c3aa3a4c312826cdfb0d617e30f0467c18ab4564/jax/_src/lax/fft.py#L211. Not terribly useful here because there they have no problems with generic broadcasting array construction

gaurav-arya added a commit to gaurav-arya/AbstractFFTs.jl that referenced this issue Jul 19, 2023
stevengj pushed a commit that referenced this issue Jul 29, 2023
* Add TestUtils submodule/extension

* Fix typo

* Support Julia 1.0

* Add missing test deps

* Add adjoint testing to test utilities

* Remove mul! method from inplace test plan (consistent with fftw)

* Fix typo

* Document test utilities

* Apply code review suggestions and refactor TestUtils

* Support Julia 1.0

* Reorder kwargs in doc string

* Also explicitly test AbstractFFTs.plan_inv

* Lift isdefined checks out of __init__

* Update src/definitions.jl

Co-authored-by: David Widmann <[email protected]>

* Note TestUtils is a weak extension

* Update function names in error handler

* Add missing test_adjoint's for BRFFT, IRFFT

* Collect x_rfft so as to not hit #112

---------

Co-authored-by: David Widmann <[email protected]>
@gaurav-arya gaurav-arya changed the title Converting scale array in adjoint computation fails for subarrays Converting scale array in adjoint computation fails for some arrays Aug 8, 2023
@gaurav-arya

This comment was marked as off-topic.

@gaurav-arya gaurav-arya changed the title Converting scale array in adjoint computation fails for some arrays Converting scale array in adjoint computation fails for subarrays Aug 9, 2023
@gaurav-arya gaurav-arya changed the title Converting scale array in adjoint computation fails for subarrays Converting scale array in adjoint plan application fails for subarrays Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant