From 2f7fd64ca47d94329d246c61c6fa6ac4357fe674 Mon Sep 17 00:00:00 2001 From: Paul Tiede Date: Wed, 24 Jul 2024 14:59:26 -0400 Subject: [PATCH] More inplace operations for Enzyme --- src/instrument/model.jl | 2 +- src/mrf_image.jl | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/instrument/model.jl b/src/instrument/model.jl index 83455271..c54951b6 100644 --- a/src/instrument/model.jl +++ b/src/instrument/model.jl @@ -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 diff --git a/src/mrf_image.jl b/src/mrf_image.jl index 78abae30..be977b95 100644 --- a/src/mrf_image.jl +++ b/src/mrf_image.jl @@ -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