提交 6a625dbb 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!883 modify timemonitor callback

Merge pull request !883 from changzherui/mod_timemonitor
...@@ -365,7 +365,7 @@ class Callback: ...@@ -365,7 +365,7 @@ class Callback:
>>> print(cb_params.cur_step_num) >>> print(cb_params.cur_step_num)
>>> >>>
>>> print_cb = Print_info() >>> print_cb = Print_info()
>>> model.train(epoch, dataset, callback=print_cb) >>> model.train(epoch, dataset, callbacks=print_cb)
""" """
def __init__(self): def __init__(self):
pass pass
...@@ -695,10 +695,3 @@ class TimeMonitor(Callback): ...@@ -695,10 +695,3 @@ class TimeMonitor(Callback):
epoch_mseconds = (time.time() - self.epoch_time) * 1000 epoch_mseconds = (time.time() - self.epoch_time) * 1000
per_step_mseconds = epoch_mseconds / self.data_size per_step_mseconds = epoch_mseconds / self.data_size
print("epoch time: {0}, per step time: {1}".format(epoch_mseconds, per_step_mseconds), flush=True) print("epoch time: {0}, per step time: {1}".format(epoch_mseconds, per_step_mseconds), flush=True)
def step_begin(self, run_context):
self.step_time = time.time()
def step_end(self, run_context):
step_mseconds = (time.time() - self.step_time) * 1000
print('step time', step_mseconds, flush=True)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册