mindspore2022/docs/api/api_python/train/mindspore.train.callback.Ti...

29 lines
790 B
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

.. py:class:: mindspore.train.callback.TimeMonitor(data_size=None)
监控训练时间。
**参数:**
- **data_size** (int) - 表示每隔多少个step打印一次信息。如果程序在训练期间获取到Model的 `batch_num` ,则将把 `data_size` 设为 `batch_num` ,否则将使用 `data_size` 。默认值None。
**异常:**
- **ValueError** - `data_size` 不是正整数。
.. py:method:: epoch_begin(run_context)
在epoch开始时记录时间。
**参数:**
- **run_context** (RunContext) - 包含模型的相关信息。
.. py:method:: epoch_end(run_context)
在epoch结束时打印epoch的耗时。
**参数:**
- **run_context** (RunContext) - 包含模型的相关信息。