From 5847e86f7783ea8f745a7465c2f4f9020c729051 Mon Sep 17 00:00:00 2001 From: Hong Ge <3279477+yebai@users.noreply.github.com> Date: Fri, 4 Aug 2023 20:55:12 +0100 Subject: [PATCH] Fix missing `logpdf` (#256) * Fix missing `logpdf` * Update Project.toml --- Project.toml | 2 +- ext/DistributionsADLazyArraysExt.jl | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index 3b06423..135695d 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "DistributionsAD" uuid = "ced4e74d-a319-5a8a-b0ac-84af2272839c" -version = "0.6.51" +version = "0.6.52" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" diff --git a/ext/DistributionsADLazyArraysExt.jl b/ext/DistributionsADLazyArraysExt.jl index f47fa2c..a030ca6 100644 --- a/ext/DistributionsADLazyArraysExt.jl +++ b/ext/DistributionsADLazyArraysExt.jl @@ -22,7 +22,7 @@ function Distributions._logpdf( dist::LazyVectorOfUnivariate, x::AbstractVector{<:Real}, ) - return sum(copy(logpdf.(dist.v, x))) + return sum(copy(Distributions.logpdf.(dist.v, x))) end function Distributions.logpdf( @@ -31,7 +31,7 @@ function Distributions.logpdf( ) size(x, 1) == length(dist) || throw(DimensionMismatch("Inconsistent array dimensions.")) - return vec(sum(copy(logpdf.(dists, x)), dims = 1)) + return vec(sum(copy(Distributions.logpdf.(dists, x)), dims = 1)) end const LazyMatrixOfUnivariate{ @@ -44,7 +44,7 @@ function Distributions._logpdf( dist::LazyMatrixOfUnivariate, x::AbstractMatrix{<:Real}, ) - return sum(copy(logpdf.(dist.dists, x))) + return sum(copy(Distributions.logpdf.(dist.dists, x))) end DistributionsAD.lazyarray(f, x...) = LazyArray(Base.broadcasted(f, x...))