Skip to content

Commit 4a15bb7

Browse files
committed
fix typed_identity spelling
1 parent f0182d9 commit 4a15bb7

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/contexts/init.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Obtain new values by sampling from the prior distribution.
7373
"""
7474
struct InitFromPrior <: AbstractInitStrategy end
7575
function init(rng::Random.AbstractRNG, ::VarName, dist::Distribution, ::InitFromPrior)
76-
return rand(rng, dist), _typed_identity
76+
return rand(rng, dist), typed_identity
7777
end
7878

7979
"""
@@ -113,7 +113,7 @@ function init(rng::Random.AbstractRNG, ::VarName, dist::Distribution, u::InitFro
113113
if x isa Array{<:Any,0}
114114
x = x[]
115115
end
116-
return x, _typed_identity
116+
return x, typed_identity
117117
end
118118

119119
"""
@@ -186,7 +186,7 @@ function init(
186186
else
187187
# TODO(penelopeysm): Since x is user-supplied, maybe we could also
188188
# check here that the type / size of x matches the dist?
189-
x, _typed_identity
189+
x, typed_identity
190190
end
191191
else
192192
p.fallback === nothing && error("No value was provided for the variable `$(vn)`.")

src/utils.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This is Float64 on 64-bit systems and Float32 on 32-bit systems.
1616
const LogProbType = float(Real)
1717

1818
"""
19-
_typed_identity(x)
19+
typed_identity(x)
2020
2121
Identity function, but with an overload for `with_logabsdet_jacobian` to ensure
2222
that it returns a sensible zero logjac.
@@ -42,12 +42,12 @@ support distributions with non-numeric samples.
4242
Furthermore, in principle, the type of the log-probability should be separate from the type
4343
of the sample. Thus, instead of using `zero(LogProbType)`, we should use the eltype of the
4444
LogJacobianAccumulator. There's no easy way to thread that through here, but if a way to do
45-
this is discovered, then `_typed_identity` is what will allow us to obtain that custom
45+
this is discovered, then `typed_identity` is what will allow us to obtain that custom
4646
behaviour.
4747
"""
48-
function _typed_identity end
49-
@inline _typed_identity(x) = x
50-
@inline Bijectors.with_logabsdet_jacobian(::typeof(_typed_identity), x) =
48+
function typed_identity end
49+
@inline typed_identity(x) = x
50+
@inline Bijectors.with_logabsdet_jacobian(::typeof(typed_identity), x) =
5151
(x, zero(LogProbType))
5252

5353
"""

0 commit comments

Comments
 (0)