diff --git a/DifferentiationInterface/ext/DifferentiationInterfaceChainRulesCoreExt/reverse_onearg.jl b/DifferentiationInterface/ext/DifferentiationInterfaceChainRulesCoreExt/reverse_onearg.jl index 14514b557..ebe0bb5b8 100644 --- a/DifferentiationInterface/ext/DifferentiationInterfaceChainRulesCoreExt/reverse_onearg.jl +++ b/DifferentiationInterface/ext/DifferentiationInterfaceChainRulesCoreExt/reverse_onearg.jl @@ -35,7 +35,7 @@ function DI.value_and_pullback( rc = ruleconfig(backend) y, pb = rrule_via_ad(rc, f, x, map(unwrap, contexts)...) tx = map(ty) do dy - pb(dy)[2] + return pb(dy)[2] end return y, tx end @@ -50,7 +50,7 @@ function DI.value_and_pullback( ) where {C} (; y, pb) = prep tx = map(ty) do dy - pb(dy)[2] + return pb(dy)[2] end return copy(y), tx end @@ -65,7 +65,7 @@ function DI.pullback( ) where {C} (; pb) = prep tx = map(ty) do dy - pb(dy)[2] + return pb(dy)[2] end return tx end diff --git a/DifferentiationInterface/ext/DifferentiationInterfaceDiffractorExt/DifferentiationInterfaceDiffractorExt.jl b/DifferentiationInterface/ext/DifferentiationInterfaceDiffractorExt/DifferentiationInterfaceDiffractorExt.jl index eae103b0c..ac1717b64 100644 --- a/DifferentiationInterface/ext/DifferentiationInterfaceDiffractorExt/DifferentiationInterfaceDiffractorExt.jl +++ b/DifferentiationInterface/ext/DifferentiationInterfaceDiffractorExt/DifferentiationInterfaceDiffractorExt.jl @@ -18,7 +18,7 @@ function DI.pushforward(f, ::NoPushforwardPrep, ::AutoDiffractor, x, tx::NTuple) # code copied from Diffractor.jl z = ∂☆{1}()(ZeroBundle{1}(f), bundle(x, dx)) dy = z[TaylorTangentIndex(1)] - dy + return dy end return ty end diff --git a/DifferentiationInterface/ext/DifferentiationInterfaceEnzymeExt/reverse_onearg.jl b/DifferentiationInterface/ext/DifferentiationInterfaceEnzymeExt/reverse_onearg.jl index f2dc28ac0..452fd2178 100644 --- a/DifferentiationInterface/ext/DifferentiationInterfaceEnzymeExt/reverse_onearg.jl +++ b/DifferentiationInterface/ext/DifferentiationInterfaceEnzymeExt/reverse_onearg.jl @@ -36,7 +36,7 @@ function batch_seeded_autodiff_thunk( dinputs = only(reverse(f, args..., dresults_righttype, tape)) else foreach(shadow_results, dresults) do d0, d - d0 .+= d # use recursive_add here? + return d0 .+= d # use recursive_add here? end dinputs = only(reverse(f, args..., tape)) end diff --git a/DifferentiationInterface/ext/DifferentiationInterfaceEnzymeExt/utils.jl b/DifferentiationInterface/ext/DifferentiationInterfaceEnzymeExt/utils.jl index 55c8e3ab8..efb6f9e25 100644 --- a/DifferentiationInterface/ext/DifferentiationInterfaceEnzymeExt/utils.jl +++ b/DifferentiationInterface/ext/DifferentiationInterfaceEnzymeExt/utils.jl @@ -10,11 +10,11 @@ to_val(::DI.BatchSizeSettings{B}) where {B} = Val(B) ## Annotations -function get_f_and_df(f::F, ::AutoEnzyme{M,Nothing}, ::Val{B}=Val(1)) where {F,M,B} +function get_f_and_df(f::F, ::AutoEnzyme{M,Nothing}; (::Val{B})=Val(1)) where {F,M,B} return f end -function get_f_and_df(f::F, ::AutoEnzyme{M,<:Const}, ::Val{B}=Val(1)) where {F,M,B} +function get_f_and_df(f::F, ::AutoEnzyme{M,<:Const}; (::Val{B})=Val(1)) where {F,M,B} return Const(f) end @@ -30,8 +30,8 @@ function get_f_and_df( EnzymeCore.DuplicatedNoNeed, EnzymeCore.BatchDuplicatedNoNeed, }, - }, - ::Val{B}=Val(1), + }; + (::Val{B})=Val(1), ) where {F,M,B} # TODO: needs more sophistication for mixed activities if B == 1 diff --git a/DifferentiationInterface/ext/DifferentiationInterfaceFastDifferentiationExt/twoarg.jl b/DifferentiationInterface/ext/DifferentiationInterfaceFastDifferentiationExt/twoarg.jl index bdd5a6781..064956dd8 100644 --- a/DifferentiationInterface/ext/DifferentiationInterfaceFastDifferentiationExt/twoarg.jl +++ b/DifferentiationInterface/ext/DifferentiationInterfaceFastDifferentiationExt/twoarg.jl @@ -32,7 +32,7 @@ function DI.pushforward( ) ty = map(tx) do dx v_vec = vcat(myvec(x), myvec(dx)) - reshape(prep.jvp_exe(v_vec), size(y)) + return reshape(prep.jvp_exe(v_vec), size(y)) end return ty end diff --git a/DifferentiationInterface/ext/DifferentiationInterfaceFiniteDiffExt/onearg.jl b/DifferentiationInterface/ext/DifferentiationInterfaceFiniteDiffExt/onearg.jl index 1e4a30a56..0ad5007a0 100644 --- a/DifferentiationInterface/ext/DifferentiationInterfaceFiniteDiffExt/onearg.jl +++ b/DifferentiationInterface/ext/DifferentiationInterfaceFiniteDiffExt/onearg.jl @@ -16,7 +16,9 @@ function DI.pushforward( ) where {C} step(t::Number, dx) = f(x .+ t .* dx, map(unwrap, contexts)...) ty = map(tx) do dx - finite_difference_derivative(Base.Fix2(step, dx), zero(eltype(x)), fdtype(backend)) + return finite_difference_derivative( + Base.Fix2(step, dx), zero(eltype(x)), fdtype(backend) + ) end return ty end @@ -32,7 +34,7 @@ function DI.value_and_pushforward( step(t::Number, dx) = f(x .+ t .* dx, map(unwrap, contexts)...) y = f(x, map(unwrap, contexts)...) ty = map(tx) do dx - finite_difference_derivative( + return finite_difference_derivative( Base.Fix2(step, dx), zero(eltype(x)), fdtype(backend), eltype(y), y ) end diff --git a/DifferentiationInterface/ext/DifferentiationInterfaceFiniteDiffExt/twoarg.jl b/DifferentiationInterface/ext/DifferentiationInterfaceFiniteDiffExt/twoarg.jl index 0d8300108..935b158af 100644 --- a/DifferentiationInterface/ext/DifferentiationInterfaceFiniteDiffExt/twoarg.jl +++ b/DifferentiationInterface/ext/DifferentiationInterfaceFiniteDiffExt/twoarg.jl @@ -21,7 +21,7 @@ function DI.value_and_pushforward( return new_y end ty = map(tx) do dx - finite_difference_derivative( + return finite_difference_derivative( Base.Fix2(step, dx), zero(eltype(x)), fdtype(backend), eltype(y), y ) end diff --git a/DifferentiationInterface/ext/DifferentiationInterfaceFiniteDifferencesExt/DifferentiationInterfaceFiniteDifferencesExt.jl b/DifferentiationInterface/ext/DifferentiationInterfaceFiniteDifferencesExt/DifferentiationInterfaceFiniteDifferencesExt.jl index 92559f219..1eff5a07a 100644 --- a/DifferentiationInterface/ext/DifferentiationInterfaceFiniteDifferencesExt/DifferentiationInterfaceFiniteDifferencesExt.jl +++ b/DifferentiationInterface/ext/DifferentiationInterfaceFiniteDifferencesExt/DifferentiationInterfaceFiniteDifferencesExt.jl @@ -34,7 +34,7 @@ function DI.pushforward( ) where {C} fc = with_contexts(f, contexts...) ty = map(tx) do dx - jvp(backend.fdm, fc, (x, dx)) + return jvp(backend.fdm, fc, (x, dx)) end return ty end @@ -69,7 +69,7 @@ function DI.pullback( ) where {C} fc = with_contexts(f, contexts...) tx = map(ty) do dy - only(j′vp(backend.fdm, fc, dy, x)) + return only(j′vp(backend.fdm, fc, dy, x)) end return tx end diff --git a/DifferentiationInterface/ext/DifferentiationInterfaceForwardDiffExt/utils.jl b/DifferentiationInterface/ext/DifferentiationInterfaceForwardDiffExt/utils.jl index a7ae576a9..31f245991 100644 --- a/DifferentiationInterface/ext/DifferentiationInterfaceForwardDiffExt/utils.jl +++ b/DifferentiationInterface/ext/DifferentiationInterfaceForwardDiffExt/utils.jl @@ -67,13 +67,13 @@ myderivative!(::Type{T}, dy, ydual) where {T} = dy .= myderivative.(T, ydual) function mypartials(::Type{T}, ::Val{B}, ydual::Number) where {T,B} return ntuple(Val(B)) do b - partials(T, ydual, b) + return partials(T, ydual, b) end end function mypartials(::Type{T}, ::Val{B}, ydual) where {T,B} return ntuple(Val(B)) do b - partials.(T, ydual, b) + return partials.(T, ydual, b) end end diff --git a/DifferentiationInterface/ext/DifferentiationInterfaceMooncakeExt/onearg.jl b/DifferentiationInterface/ext/DifferentiationInterfaceMooncakeExt/onearg.jl index 8157b34bc..5d8fdd3f2 100644 --- a/DifferentiationInterface/ext/DifferentiationInterfaceMooncakeExt/onearg.jl +++ b/DifferentiationInterface/ext/DifferentiationInterfaceMooncakeExt/onearg.jl @@ -73,7 +73,7 @@ function DI.value_and_pullback( ) where {C} ys_and_tx = map(ty) do dy y, tx = DI.value_and_pullback(f, prep, backend, x, (dy,), contexts...) - y, only(tx) + return y, only(tx) end y = first(ys_and_tx[1]) tx = last.(ys_and_tx) @@ -91,7 +91,7 @@ function DI.value_and_pullback!( ) where {C} ys = map(tx, ty) do dx, dy y, _ = DI.value_and_pullback!(f, (dx,), prep, backend, x, (dy,), contexts...) - y + return y end y = ys[1] return y, tx diff --git a/DifferentiationInterface/ext/DifferentiationInterfaceMooncakeExt/twoarg.jl b/DifferentiationInterface/ext/DifferentiationInterfaceMooncakeExt/twoarg.jl index f1c158435..c6949409f 100644 --- a/DifferentiationInterface/ext/DifferentiationInterfaceMooncakeExt/twoarg.jl +++ b/DifferentiationInterface/ext/DifferentiationInterfaceMooncakeExt/twoarg.jl @@ -84,7 +84,7 @@ function DI.value_and_pullback( ) where {C} tx = map(ty) do dy _, tx = DI.value_and_pullback(f!, y, prep, backend, x, (dy,), contexts...) - only(tx) + return only(tx) end return y, tx end diff --git a/DifferentiationInterface/ext/DifferentiationInterfaceReverseDiffExt/twoarg.jl b/DifferentiationInterface/ext/DifferentiationInterfaceReverseDiffExt/twoarg.jl index 4b0673be7..093786c79 100644 --- a/DifferentiationInterface/ext/DifferentiationInterfaceReverseDiffExt/twoarg.jl +++ b/DifferentiationInterface/ext/DifferentiationInterfaceReverseDiffExt/twoarg.jl @@ -24,7 +24,7 @@ function DI.value_and_pullback( return dot(y_copy, dy) end tx = map(ty) do dy - gradient(Fix2(dotclosure, dy), x) + return gradient(Fix2(dotclosure, dy), x) end fc!(y, x) return y, tx @@ -70,7 +70,7 @@ function DI.pullback( return dot(y_copy, dy) end tx = map(ty) do dy - gradient(Fix2(dotclosure, dy), x) + return gradient(Fix2(dotclosure, dy), x) end return tx end diff --git a/DifferentiationInterface/ext/DifferentiationInterfaceSymbolicsExt/onearg.jl b/DifferentiationInterface/ext/DifferentiationInterfaceSymbolicsExt/onearg.jl index 60c222310..5822ff987 100644 --- a/DifferentiationInterface/ext/DifferentiationInterfaceSymbolicsExt/onearg.jl +++ b/DifferentiationInterface/ext/DifferentiationInterfaceSymbolicsExt/onearg.jl @@ -35,7 +35,7 @@ function DI.pushforward( ) ty = map(tx) do dx v_vec = vcat(myvec(x), myvec(dx)) - dy = prep.pf_exe(v_vec) + return dy = prep.pf_exe(v_vec) end return ty end @@ -302,7 +302,7 @@ function DI.hvp(f, prep::SymbolicsOneArgHVPPrep, ::AutoSymbolics, x, tx::NTuple) return map(tx) do dx v_vec = vcat(vec(x), vec(dx)) dg_vec = prep.hvp_exe(v_vec) - reshape(dg_vec, size(x)) + return reshape(dg_vec, size(x)) end end diff --git a/DifferentiationInterface/ext/DifferentiationInterfaceSymbolicsExt/twoarg.jl b/DifferentiationInterface/ext/DifferentiationInterfaceSymbolicsExt/twoarg.jl index 3773d601d..2370dcc21 100644 --- a/DifferentiationInterface/ext/DifferentiationInterfaceSymbolicsExt/twoarg.jl +++ b/DifferentiationInterface/ext/DifferentiationInterfaceSymbolicsExt/twoarg.jl @@ -33,7 +33,7 @@ function DI.pushforward( ) ty = map(tx) do dx v_vec = vcat(myvec(x), myvec(dx)) - dy = prep.pushforward_exe(v_vec) + return dy = prep.pushforward_exe(v_vec) end return ty end diff --git a/DifferentiationInterface/ext/DifferentiationInterfaceTrackerExt/DifferentiationInterfaceTrackerExt.jl b/DifferentiationInterface/ext/DifferentiationInterfaceTrackerExt/DifferentiationInterfaceTrackerExt.jl index 7621d1e02..dea1156b0 100644 --- a/DifferentiationInterface/ext/DifferentiationInterfaceTrackerExt/DifferentiationInterfaceTrackerExt.jl +++ b/DifferentiationInterface/ext/DifferentiationInterfaceTrackerExt/DifferentiationInterfaceTrackerExt.jl @@ -34,7 +34,7 @@ function DI.value_and_pullback( ) where {C} y, pb = forward(f, x, map(unwrap, contexts)...) tx = map(ty) do dy - data(first(pb(dy))) + return data(first(pb(dy))) end return y, tx end @@ -49,7 +49,7 @@ function DI.value_and_pullback( ) where {C} (; y, pb) = prep tx = map(ty) do dy - data(first(pb(dy))) + return data(first(pb(dy))) end return copy(y), tx end @@ -64,7 +64,7 @@ function DI.pullback( ) where {C} (; pb) = prep tx = map(ty) do dy - data(first(pb(dy))) + return data(first(pb(dy))) end return tx end diff --git a/DifferentiationInterface/ext/DifferentiationInterfaceZygoteExt/DifferentiationInterfaceZygoteExt.jl b/DifferentiationInterface/ext/DifferentiationInterfaceZygoteExt/DifferentiationInterfaceZygoteExt.jl index e73be43e5..d0fb1139e 100644 --- a/DifferentiationInterface/ext/DifferentiationInterfaceZygoteExt/DifferentiationInterfaceZygoteExt.jl +++ b/DifferentiationInterface/ext/DifferentiationInterfaceZygoteExt/DifferentiationInterfaceZygoteExt.jl @@ -45,7 +45,7 @@ function DI.value_and_pullback( ) where {C} y, pb = pullback(f, x, map(unwrap, contexts)...) tx = map(ty) do dy - first(pb(dy)) + return first(pb(dy)) end return y, tx end @@ -60,7 +60,7 @@ function DI.value_and_pullback( ) where {C} (; y, pb) = prep tx = map(ty) do dy - first(pb(dy)) + return first(pb(dy)) end return copy(y), tx end @@ -75,7 +75,7 @@ function DI.pullback( ) where {C} (; pb) = prep tx = map(ty) do dy - first(pb(dy)) + return first(pb(dy)) end return tx end diff --git a/DifferentiationInterface/src/first_order/pullback.jl b/DifferentiationInterface/src/first_order/pullback.jl index ebf74a26b..e872f0997 100644 --- a/DifferentiationInterface/src/first_order/pullback.jl +++ b/DifferentiationInterface/src/first_order/pullback.jl @@ -182,7 +182,7 @@ function _pullback_via_pushforward( ) where {F,C} dx = map(CartesianIndices(x)) do j t1 = pushforward(f, pushforward_prep, backend, x, (basis(backend, x, j),), contexts...) - dot(dy, only(t1)) + return dot(dy, only(t1)) end return dx end @@ -270,7 +270,7 @@ function _pullback_via_pushforward( t1 = pushforward( f!, y, pushforward_prep, backend, x, (basis(backend, x, j),), contexts... ) - dot(dy, only(t1)) + return dot(dy, only(t1)) end return dx end diff --git a/DifferentiationInterface/src/first_order/pushforward.jl b/DifferentiationInterface/src/first_order/pushforward.jl index 83475757b..34233b656 100644 --- a/DifferentiationInterface/src/first_order/pushforward.jl +++ b/DifferentiationInterface/src/first_order/pushforward.jl @@ -191,7 +191,7 @@ function _pushforward_via_pullback( ) where {F,C} dy = map(CartesianIndices(y)) do i t1 = pullback(f, pullback_prep, backend, x, (basis(backend, y, i),), contexts...) - dot(dx, only(t1)) + return dot(dx, only(t1)) end return dy end @@ -263,7 +263,7 @@ function _pushforward_via_pullback( ) where {F,C} dy = map(CartesianIndices(y)) do i # preserve shape t1 = pullback(f!, y, pullback_prep, backend, x, (basis(backend, y, i),), contexts...) - dot(dx, only(t1)) + return dot(dx, only(t1)) end return dy end diff --git a/DifferentiationInterface/src/second_order/hvp.jl b/DifferentiationInterface/src/second_order/hvp.jl index 67ee0003f..87a70d4bc 100644 --- a/DifferentiationInterface/src/second_order/hvp.jl +++ b/DifferentiationInterface/src/second_order/hvp.jl @@ -193,7 +193,7 @@ function hvp( (; outer_gradient_prep) = prep rewrap = Rewrap(contexts...) tg = map(tx) do dx - gradient( + return gradient( shuffled_single_pushforward, outer_gradient_prep, outer(backend), diff --git a/DifferentiationInterface/test/Misc/DifferentiateWith/test.jl b/DifferentiationInterface/test/Misc/DifferentiateWith/test.jl index c8ea57c0b..15fb6273d 100644 --- a/DifferentiationInterface/test/Misc/DifferentiateWith/test.jl +++ b/DifferentiationInterface/test/Misc/DifferentiateWith/test.jl @@ -13,10 +13,10 @@ LOGGING = get(ENV, "CI", "false") == "false" function differentiatewith_scenarios() bad_scens = # these closurified scenarios have mutation and type constraints filter(default_scenarios(; include_normal=false, include_closurified=true)) do scen - DIT.function_place(scen) == :out + return DIT.function_place(scen) == :out end good_scens = map(bad_scens) do scen - DIT.change_function(scen, DifferentiateWith(scen.f, AutoFiniteDiff())) + return DIT.change_function(scen, DifferentiateWith(scen.f, AutoFiniteDiff())) end return good_scens end diff --git a/DifferentiationInterface/test/Misc/ZeroBackends/test.jl b/DifferentiationInterface/test/Misc/ZeroBackends/test.jl index b352fee87..daa48db98 100644 --- a/DifferentiationInterface/test/Misc/ZeroBackends/test.jl +++ b/DifferentiationInterface/test/Misc/ZeroBackends/test.jl @@ -46,7 +46,7 @@ test_differentiation( ) test_differentiation( - AutoSparse.(zero_backends, coloring_algorithm=GreedyColoringAlgorithm()), + AutoSparse.(zero_backends; coloring_algorithm=GreedyColoringAlgorithm()), default_scenarios(; include_constantified=true); correctness=false, type_stability=:full, diff --git a/DifferentiationInterfaceTest/ext/DifferentiationInterfaceTestComponentArraysExt/DifferentiationInterfaceTestComponentArraysExt.jl b/DifferentiationInterfaceTest/ext/DifferentiationInterfaceTestComponentArraysExt/DifferentiationInterfaceTestComponentArraysExt.jl index ff3f7bf15..6deb8ea4b 100644 --- a/DifferentiationInterfaceTest/ext/DifferentiationInterfaceTestComponentArraysExt/DifferentiationInterfaceTestComponentArraysExt.jl +++ b/DifferentiationInterfaceTest/ext/DifferentiationInterfaceTestComponentArraysExt/DifferentiationInterfaceTestComponentArraysExt.jl @@ -13,7 +13,7 @@ function comp_to_num(x::ComponentVector)::Number return sum(sin.(x.a)) + sum(cos.(x.b)) end -comp_to_num_gradient(x) = ComponentVector(; a=cos.(x.a), b=-sin.(x.b)) +comp_to_num_gradient(x) = ComponentVector(; a=cos.(x.a), b=(-sin.(x.b))) function comp_to_num_pushforward(x, dx) g = comp_to_num_gradient(x) diff --git a/DifferentiationInterfaceTest/src/scenarios/sparse.jl b/DifferentiationInterfaceTest/src/scenarios/sparse.jl index 7d3cc8961..0c5026cd8 100644 --- a/DifferentiationInterfaceTest/src/scenarios/sparse.jl +++ b/DifferentiationInterfaceTest/src/scenarios/sparse.jl @@ -56,8 +56,8 @@ end function diffsquarecube_matvec!(y::AbstractVector, x::AbstractMatrix) m, n = size(x) - diffsquare!(view(y, 1:(m * n - 1)), vec(x)) - diffcube!(view(y, (m * n):(2(m * n) - 2)), vec(x)) + diffsquare!(view(y, 1:(m*n-1)), vec(x)) + diffcube!(view(y, (m*n):(2(m*n)-2)), vec(x)) return nothing end diff --git a/DifferentiationInterfaceTest/src/tests/correctness_eval.jl b/DifferentiationInterfaceTest/src/tests/correctness_eval.jl index 7d990fe92..3c8edd5e9 100644 --- a/DifferentiationInterfaceTest/src/tests/correctness_eval.jl +++ b/DifferentiationInterfaceTest/src/tests/correctness_eval.jl @@ -59,7 +59,7 @@ for op in ALL_OPS xrand, contextsrand..., ) - [(), (prep,), (prepprep,)] + return [(), (prep,), (prepprep,)] end for (preptup_val, preptup_noval) in zip(preptup_cands_val, preptup_cands_noval) y_out1_val, res1_out1_val = $val_and_op( @@ -112,7 +112,7 @@ for op in ALL_OPS xrand, contextsrand..., ) - [(), (prep,), (prepprep,)] + return [(), (prep,), (prepprep,)] end for (preptup_val, preptup_noval) in zip(preptup_cands_val, preptup_cands_noval) res1_in1_val = mysimilar(res1) @@ -180,7 +180,7 @@ for op in ALL_OPS xrand, contextsrand..., ) - [(), (prep,), (prepprep,)] + return [(), (prep,), (prepprep,)] end for (preptup_val, preptup_noval) in zip(preptup_cands_val, preptup_cands_noval) y_in1_val = mysimilar(y) @@ -240,7 +240,7 @@ for op in ALL_OPS xrand, contextsrand..., ) - [(), (prep,), (prepprep,)] + return [(), (prep,), (prepprep,)] end for (preptup_val, preptup_noval) in zip(preptup_cands_val, preptup_cands_noval) y_in1_val, res1_in1_val = mysimilar(y), mysimilar(res1) @@ -308,7 +308,7 @@ for op in ALL_OPS xrand, contextsrand..., ) - [(), (prep,), (prepprep,)] + return [(), (prep,), (prepprep,)] end for (preptup_val, preptup_noval) in zip(preptup_cands_val, preptup_cands_noval) y_out1_val, res1_out1_val, res2_out1_val = $val_and_op( @@ -363,7 +363,7 @@ for op in ALL_OPS xrand, contextsrand..., ) - [(), (prep,), (prepprep,)] + return [(), (prep,), (prepprep,)] end for (preptup_val, preptup_noval) in zip(preptup_cands_val, preptup_cands_noval) res1_in1_val, res2_in1_val = mysimilar(res1), mysimilar(res2) @@ -435,7 +435,7 @@ for op in ALL_OPS contextsrand..., ) prep_same = $prep_op_same(f, ba, x, tangrand, contexts...) - [(), (prep,), (prepprep,), (prep_same,)] + return [(), (prep,), (prepprep,), (prep_same,)] end for (preptup_val, preptup_noval) in zip(preptup_cands_val, preptup_cands_noval) y_out1_val, res1_out1_val = $val_and_op( @@ -484,7 +484,7 @@ for op in ALL_OPS contextsrand..., ) prep_same = $prep_op_same(f, ba, x, tangrand, contexts...) - [(), (prep,), (prepprep,), (prep_same,)] + return [(), (prep,), (prepprep,), (prep_same,)] end for (preptup_val, preptup_noval) in zip(preptup_cands_val, preptup_cands_noval) res1_in1_val = mysimilar(res1) @@ -546,7 +546,7 @@ for op in ALL_OPS contextsrand..., ) prep_same = $prep_op_same(f, copy(yrand), ba, x, tangrand, contexts...) - [(), (prep,), (prepprep,), (prep_same,)] + return [(), (prep,), (prepprep,), (prep_same,)] end for (preptup_val, preptup_noval) in zip(preptup_cands_val, preptup_cands_noval) y_in1_val = mysimilar(y) @@ -606,7 +606,7 @@ for op in ALL_OPS contextsrand..., ) prep_same = $prep_op_same(f, copy(yrand), ba, x, tangrand, contexts...) - [(), (prep,), (prepprep,), (prep_same,)] + return [(), (prep,), (prepprep,), (prep_same,)] end for (preptup_val, preptup_noval) in zip(preptup_cands_val, preptup_cands_noval) y_in1_val, res1_in1_val = mysimilar(y), mysimilar(res1)