mindquantum.utils.SingleLoopProgress
- class mindquantum.utils.SingleLoopProgress(n_loop: int, loop_name: str = 'Task')[源代码]
一个用于展示拥有一层循环任务的进度的进度条。
- 参数:
n_loop (int) - 循环的个数。
loop_name (str) - 循环的进度条的标题。默认值:
"Task"
。
样例:
>>> import time >>> from mindquantum.utils import SingleLoopProgress >>> with SingleLoopProgress(100) as progress: >>> for batch in range(100): >>> progress.update_loop(batch) >>> time.sleep(0.01)