From 4c126d883f989767656ce3f7032326c1272a263f Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Fri, 15 Nov 2024 19:11:55 +0100 Subject: [PATCH] Restrict single-threading to single sequence --- src/inference/forward.jl | 2 +- src/inference/forward_backward.jl | 2 +- src/inference/viterbi.jl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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