def test_missing_train(self):
"""Test KeyError raised on missing profile entries."""
with LogCapture() as log_capture:
self._hook.after_epoch_profile(0, {}, [])
log_capture.check(
('root', 'INFO', '\tT read data:\t0.000000'),
('root', 'INFO', '\tT train:\t0.000000'),
('root', 'INFO', '\tT eval:\t0.000000'),
('root', 'INFO', '\tT hooks:\t0.000000')
)
with LogCapture() as log_capture:
self._hook.after_epoch_profile(0, {'some_contents': 1}, [])
log_capture.check(
('root', 'INFO', '\tT read data:\t0.000000'),
('root', 'INFO', '\tT train:\t0.000000'),
('root', 'INFO', '\tT eval:\t0.000000'),
('root', 'INFO', '\tT hooks:\t0.000000')
)
评论列表
文章目录