Browse Source

!883 modify timemonitor callback

Merge pull request !883 from changzherui/mod_timemonitor
tags/v0.3.0-alpha
mindspore-ci-bot Gitee 5 years ago
parent
commit
6a625dbb7b
1 changed files with 1 additions and 8 deletions
  1. +1
    -8
      mindspore/train/callback.py

+ 1
- 8
mindspore/train/callback.py View File

@@ -365,7 +365,7 @@ class Callback:
>>> print(cb_params.cur_step_num)
>>>
>>> print_cb = Print_info()
>>> model.train(epoch, dataset, callback=print_cb)
>>> model.train(epoch, dataset, callbacks=print_cb)
"""
def __init__(self):
pass
@@ -695,10 +695,3 @@ class TimeMonitor(Callback):
epoch_mseconds = (time.time() - self.epoch_time) * 1000
per_step_mseconds = epoch_mseconds / self.data_size
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)

Loading…
Cancel
Save