Skip to content

Commit

Permalink
Get docstring without @doc to avoid error when compiling (#116)
Browse files Browse the repository at this point in the history
* Get docstring without @doc to avoid error when compiling

Fixes #113.

* Add comment with link to upstream @doc issue
  • Loading branch information
donm authored and KristofferC committed Apr 8, 2019
1 parent 19fdbfc commit bb54e3b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/metrics.jl
Expand Up @@ -332,10 +332,13 @@ function eval_end(dist::RenyiDivergence, s::Tuple{T,T,T,T}) where {T <: Real}
end
end

# Combine docs with RenyiDivergence
@doc (@doc RenyiDivergence) renyi_divergence

renyi_divergence(a::AbstractArray, b::AbstractArray, q::Real) = evaluate(RenyiDivergence(q), a, b)
# Combine docs with RenyiDivergence. Fetching the docstring with @doc causes
# problems during package compilation; see
# https://github.com/JuliaLang/julia/issues/31640
let docstring = Base.Docs.getdoc(RenyiDivergence)
@doc docstring renyi_divergence
end

# JSDivergence
@inline function eval_op(::JSDivergence, ai::T, bi::T) where {T}
Expand Down

0 comments on commit bb54e3b

Please sign in to comment.