Skip to content

Commit b1c1a6e

Browse files
authoredJul 5, 2023
Remove Zygote rule for *(::AbstractFFTs.Plan, ::AbstractArray)
The potentially incorrect Zygote rules for FFT (FluxML#899) can be removed now that comprehensive Chain Rules have been added in JuliaMath/AbstractFFTs.jl#67
1 parent 2f49370 commit b1c1a6e

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed
 

‎src/lib/array.jl

-16
Original file line numberDiff line numberDiff line change
@@ -674,22 +674,6 @@ AbstractFFTs.rfft(x::Fill, dims...) = AbstractFFTs.rfft(collect(x), dims...)
674674
AbstractFFTs.irfft(x::Fill, d, dims...) = AbstractFFTs.irfft(collect(x), d, dims...)
675675
AbstractFFTs.brfft(x::Fill, d, dims...) = AbstractFFTs.brfft(collect(x), d, dims...)
676676

677-
# the adjoint jacobian of an FFT with respect to its input is the reverse FFT of the
678-
# gradient of its inputs, but with different normalization factor
679-
@adjoint function *(P::AbstractFFTs.Plan, xs)
680-
return P * xs, function(Δ)
681-
N = prod(size(xs)[[P.region...]])
682-
return (nothing, N * (P \ Δ))
683-
end
684-
end
685-
686-
@adjoint function \(P::AbstractFFTs.Plan, xs)
687-
return P \ xs, function(Δ)
688-
N = prod(size(Δ)[[P.region...]])
689-
return (nothing, (P * Δ)/N)
690-
end
691-
end
692-
693677
# FillArray functionality
694678
# =======================
695679

0 commit comments

Comments
 (0)
Please sign in to comment.