From e50987df4dd7160c237c885f0a92f02ff1c660b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Arrufat?= <1671644+arrufat@users.noreply.github.com> Date: Tue, 6 Sep 2022 05:00:46 +0900 Subject: [PATCH] Fix visitor when tag layer is followed by skip layer (#2662) --- dlib/dnn/visitors.h | 9 +++++++++ docs/docs/release_notes.xml | 1 + 2 files changed, 10 insertions(+) diff --git a/dlib/dnn/visitors.h b/dlib/dnn/visitors.h index bd0c75efc..a8003cc6e 100644 --- a/dlib/dnn/visitors.h +++ b/dlib/dnn/visitors.h @@ -608,6 +608,15 @@ namespace dlib // update(i); } + // Handle the special case when the tag layer is followed by a skip layer + template class TAG, typename U, typename E> + void operator()(size_t i, const add_tag_layer, E>&) + { + tagged_layers.push_back(i); + const auto t = tag_id::id; + tag_to_layer.at(t) = from; + } + template