From 8a6cadfd05e17806ee313c01d811360bc67abfa1 Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Mon, 11 Sep 2023 12:55:53 +0200 Subject: [PATCH] Test allocations on 1.9 --- src/inference/forward_backward.jl | 7 +------ test/runtests.jl | 8 ++++---- test/testitems.jl | 8 ++++---- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/inference/forward_backward.jl b/src/inference/forward_backward.jl index df7d7aeb..d8777de1 100644 --- a/src/inference/forward_backward.jl +++ b/src/inference/forward_backward.jl @@ -34,12 +34,7 @@ Base.length(fb::ForwardBackwardStorage) = size(fb.α, 1) duration(fb::ForwardBackwardStorage) = size(fb.α, 2) function loglikelihood(fb::ForwardBackwardStorage{R}) where {R} - logL = zero(R) - logL -= sum(log, fb.c) - logL += sum(fb.logm) - # for t in 1:duration(fb) - # logL += -log(fb.c[t]) + fb.logm[t] - # end + logL = -sum(log, fb.c) + sum(fb.logm) return logL end diff --git a/test/runtests.jl b/test/runtests.jl index e67e9398..ad73896f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -17,6 +17,10 @@ using Test @testset verbose = true "Type stability" begin include("type_stability.jl") end + + @testset verbose = true "Allocations" begin + include("allocations.jl") + end end @testset "Interface" begin @@ -31,10 +35,6 @@ using Test include("correctness.jl") end - @testset verbose = true "Allocations" begin - include("allocations.jl") - end - @testset verbose = true "Sparse" begin include("sparse.jl") end diff --git a/test/testitems.jl b/test/testitems.jl index 4fd55348..1a52d381 100644 --- a/test/testitems.jl +++ b/test/testitems.jl @@ -18,6 +18,10 @@ end include("type_stability.jl") end +@testitem "Allocations" begin + include("allocations.jl") +end + @testitem "Interface" begin include("interface.jl") end @@ -30,10 +34,6 @@ end include("correctness.jl") end -@testitem "Allocations" begin - include("allocations.jl") -end - @testitem "Sparse" begin include("sparse.jl") end