Skip to content

Commit cda780a

Browse files
committed
fix definition order
1 parent a3a4795 commit cda780a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/contexts/init.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,6 @@ into a `Vector{Float64}` with a `ForwardDiff.Dual` or similar tracer type, for e
5757
those use `Accessors.@set` under the hood, which also does the promotion for you.)
5858
"""
5959
get_param_eltype(::AbstractInitStrategy) = Any
60-
function get_param_eltype(strategy::InitFromParams{<:VectorWithRanges})
61-
return eltype(strategy.params.vect)
62-
end
63-
function get_param_eltype(
64-
strategy::InitFromParams{<:Union{AbstractDict{<:VarName},NamedTuple}}
65-
)
66-
return infer_nested_eltype(typeof(strategy.params))
67-
end
6860

6961
"""
7062
InitFromPrior()
@@ -193,6 +185,11 @@ function init(
193185
init(rng, vn, dist, p.fallback)
194186
end
195187
end
188+
function get_param_eltype(
189+
strategy::InitFromParams{<:Union{AbstractDict{<:VarName},NamedTuple}}
190+
)
191+
return infer_nested_eltype(typeof(strategy.params))
192+
end
196193

197194
"""
198195
RangeAndLinked
@@ -261,6 +258,9 @@ function init(
261258
end
262259
return (@view vr.vect[range_and_linked.range]), transform
263260
end
261+
function get_param_eltype(strategy::InitFromParams{<:VectorWithRanges})
262+
return eltype(strategy.params.vect)
263+
end
264264

265265
"""
266266
InitContext(

0 commit comments

Comments
 (0)