(self)
| 32 | class ClusterTest(test.TestCase): |
| 33 | |
| 34 | def testBasic(self): |
| 35 | with ops.Graph().as_default() as g: |
| 36 | a = random_ops.random_uniform(shape=()) |
| 37 | b = random_ops.random_uniform(shape=()) |
| 38 | c = a + b |
| 39 | train_op = ops.get_collection_ref(ops.GraphKeys.TRAIN_OP) |
| 40 | train_op.append(c) |
| 41 | mg = meta_graph.create_meta_graph_def(graph=g) |
| 42 | grappler_item = item.Item(mg) |
| 43 | grappler_cluster = cluster.Cluster( |
| 44 | disable_detailed_stats=False, disable_timeline=False) |
| 45 | op_perfs, run_time, step_stats = grappler_cluster.MeasureCosts( |
| 46 | grappler_item) |
| 47 | self.assertTrue(run_time > 0) |
| 48 | self.assertEqual(len(op_perfs), 4) |
| 49 | self.assertTrue(step_stats.dev_stats) |
| 50 | |
| 51 | def testNoDetailedStats(self): |
| 52 | with ops.Graph().as_default() as g: |
nothing calls this directly
no test coverage detected