diff --git a/libs/HMMTest/src/allocations.jl b/libs/HMMTest/src/allocations.jl index 8deedaf..b75e348 100644 --- a/libs/HMMTest/src/allocations.jl +++ b/libs/HMMTest/src/allocations.jl @@ -7,7 +7,7 @@ function test_allocations( hmm_guess::Union{Nothing,AbstractHMM}=nothing, ) # making seq_ends a tuple disables multithreading - seq_ends = ntuple(k -> seq_ends[k], Val(min(2, length(seq_ends)))) + seq_ends = ntuple(k -> seq_ends[k], Val(min(1, length(seq_ends)))) control_seq = control_seq[1:last(seq_ends)] @testset "Allocations" begin diff --git a/src/inference/forward.jl b/src/inference/forward.jl index 615c70a..5e6e251 100644 --- a/src/inference/forward.jl +++ b/src/inference/forward.jl @@ -123,7 +123,7 @@ function forward!( control_seq::AbstractVector; seq_ends::AbstractVectorOrNTuple{Int}, ) - if seq_ends isa NTuple + if seq_ends isa NTuple{1} for k in eachindex(seq_ends) _forward!(storage, hmm, obs_seq, control_seq, seq_ends, k) end diff --git a/src/inference/forward_backward.jl b/src/inference/forward_backward.jl index 44f5aba..ba51ad4 100644 --- a/src/inference/forward_backward.jl +++ b/src/inference/forward_backward.jl @@ -81,7 +81,7 @@ function forward_backward!( seq_ends::AbstractVectorOrNTuple{Int}, transition_marginals::Bool=true, ) - if seq_ends isa NTuple + if seq_ends isa NTuple{1} for k in eachindex(seq_ends) _forward_backward!( storage, hmm, obs_seq, control_seq, seq_ends, k; transition_marginals diff --git a/src/inference/viterbi.jl b/src/inference/viterbi.jl index c20632c..f4f5270 100644 --- a/src/inference/viterbi.jl +++ b/src/inference/viterbi.jl @@ -83,7 +83,7 @@ function viterbi!( control_seq::AbstractVector; seq_ends::AbstractVectorOrNTuple{Int}, ) where {R} - if seq_ends isa NTuple + if seq_ends isa NTuple{1} for k in eachindex(seq_ends) _viterbi!(storage, hmm, obs_seq, control_seq, seq_ends, k) end