def test_report_scope(self): reporter = chainer.Reporter() observation = {} with reporter: with chainer.report_scope(observation): chainer.report({'x': 1}) self.assertIn('x', observation) self.assertEqual(observation['x'], 1) self.assertNotIn('x', reporter.observation)
def test_report_scope(self): reporter = chainer.Reporter() observation = {} with reporter: with chainer.report_scope(observation): chainer.report({'x': 1}) self.assertIn('x', observation) self.assertEqual(observation['x'], 1) self.assertNotIn('x', reporter.observation)