From a458c01a9f25b3e3d6082f037768b657a65bc888 Mon Sep 17 00:00:00 2001 From: ShenYuhan Date: Thu, 17 Jun 2021 14:42:11 +0800 Subject: [PATCH] Keep the last item when displaying content --- visualdl/server/data_manager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/visualdl/server/data_manager.py b/visualdl/server/data_manager.py index d4272cc7..74bb671e 100644 --- a/visualdl/server/data_manager.py +++ b/visualdl/server/data_manager.py @@ -264,6 +264,8 @@ class _ReservoirBucket(object): if r < self._max_size: self._items.pop(r) self._items.append(item) + else: + self._items[-1] = item self._num_items_index += 1 def add_scalar_item(self, item): @@ -296,6 +298,8 @@ class _ReservoirBucket(object): r = r + 1 self._items.pop(r) self._items.append(item) + else: + self._items[-1] = item self._num_items_index += 1 -- GitLab