justheuristic 4 年 前
コミット
b6c2cf65cd
1 ファイル変更3 行追加0 行削除
  1. 3 0
      hivemind/optim/performance_ema.py

+ 3 - 0
hivemind/optim/performance_ema.py

@@ -44,6 +44,9 @@ class PerformanceEMA:
             self.timestamp = get_dht_time()
             self.paused = was_paused
 
+    def __repr__(self):
+        return f"{self.__class__.__name__}(ema={self.samples_per_second:.5f}, num_updates={self.num_updates})"
+
     @contextmanager
     def update_threadsafe(self, task_size: int):
         """measure the EMA throughout of the code that runs inside the context"""