Skip to content

Commit

Permalink
More inplace operations for Enzyme
Browse files Browse the repository at this point in the history
  • Loading branch information
ptiede committed Jul 24, 2024
1 parent ff778a6 commit 2f7fd64
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/instrument/model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function apply_instrument(vis, J::ObservedInstrumentModel, x)
end

function apply_instrument(vis, J::ObservedInstrumentModel{<:Union{JonesR, JonesF}}, x)
vout = intout(vis)
vout = vis#intout(vis)
_apply_instrument!(baseimage(vout), baseimage(vis), J, (;))
return vout
end
Expand Down
6 changes: 4 additions & 2 deletions src/mrf_image.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ end

function _apply_fluctuations(t::VLBIImagePriors.LogRatioTransform, mimg::AbstractArray, δ::AbstractArray)
@argcheck isapprox(sum(mimg), 1, atol=1e-6) "Mean image must have unit flux when using log-ratio transformations in apply_fluctuations"
r = baseimage(mimg).*to_simplex(t, δ)
return r./sum(r)
r = to_simplex(t, δ)
r .= r.*parent(mimg)
r .= r./sum(r)
return r
end

0 comments on commit 2f7fd64

Please sign in to comment.