Skip to content

Commit 35939bb

Browse files
authored
Merge pull request #36 from bionanoimaging/fix_conv_rrule
Remove wrong rule to fix issue #35
2 parents 70ec7bf + 79cd82a commit 35939bb

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

src/convolutions.jl

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,6 @@ function conv_psf(u::AbstractArray{T, N}, psf::AbstractArray{D, M}, dims=ntuple(
7474
return conv(u, ifftshift(psf, dims), dims)
7575
end
7676

77-
# define custom adjoint for conv
78-
# so far only defined for the derivative regarding the first component
79-
function ChainRulesCore.rrule(::typeof(conv), u::AbstractArray{T, N}, v::AbstractArray{D, M},
80-
dims=ntuple(+, min(N, M))) where {T, D, N, M}
81-
Y = conv(u, v, dims)
82-
function conv_pullback(barx)
83-
z = zero(eltype(u))
84-
return NoTangent(), conv(barx, conj(v), dims), z, z
85-
end
86-
return Y, conv_pullback
87-
end
88-
8977

9078

9179
"""
@@ -219,15 +207,6 @@ function p_conv_aux(P, P_inv, u, v_ft)
219207
return (P_inv.p * ((P * u) .* v_ft .* P_inv.scale))
220208
end
221209

222-
function ChainRulesCore.rrule(::typeof(p_conv_aux), P, P_inv, u, v)
223-
Y = p_conv_aux(P, P_inv, u, v)
224-
function conv_pullback(barx)
225-
z = zero(eltype(u))
226-
= p_conv_aux(P, P_inv, barx, conj(v))
227-
return NoTangent(), z, z, ∇, z
228-
end
229-
return Y, conv_pullback
230-
end
231210

232211
"""
233212
fft_or_rfft(T)

0 commit comments

Comments
 (0)