Unverified Commit 215a3244 authored by Yang Li's avatar Yang Li Committed by GitHub
Browse files

Support update specific steps (#437)

parent 82e5c8e5
...@@ -32,8 +32,9 @@ class ProgressBar: ...@@ -32,8 +32,9 @@ class ProgressBar:
self.file.flush() self.file.flush()
self.timer = Timer() self.timer = Timer()
def update(self): def update(self, num_tasks=1):
self.completed += 1 assert num_tasks > 0
self.completed += num_tasks
elapsed = self.timer.since_start() elapsed = self.timer.since_start()
if elapsed > 0: if elapsed > 0:
fps = self.completed / elapsed fps = self.completed / elapsed
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment