(self)
| 31 | class ProfilerTest(test_util.TensorFlowTestCase): |
| 32 | |
| 33 | def test_profile(self): |
| 34 | profiler.start() |
| 35 | three = constant_op.constant(3) |
| 36 | five = constant_op.constant(5) |
| 37 | product = three * five |
| 38 | self.assertAllEqual(15, product) |
| 39 | with self.assertRaises(profiler.ProfilerAlreadyRunningError): |
| 40 | profiler.start() |
| 41 | |
| 42 | profile_result = profiler.stop() |
| 43 | profile_pb = trace_events_pb2.Trace() |
| 44 | profile_pb.ParseFromString(profile_result) |
| 45 | profile_pb_str = '%s' % profile_pb |
| 46 | self.assertTrue('Mul' in profile_pb_str) |
| 47 | with self.assertRaises(profiler.ProfilerNotRunningError): |
| 48 | profiler.stop() |
| 49 | |
| 50 | def test_save_profile(self): |
| 51 | logdir = self.get_temp_dir() |
nothing calls this directly
no test coverage detected