log_profile_test.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:cxflow 作者: Cognexa 项目源码 文件源码
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')
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号