(self)
| 114 | self.assertEqual(7680.0, estimated_perf) |
| 115 | |
| 116 | def testContext(self): |
| 117 | with ops.Graph().as_default() as g: |
| 118 | a = random_ops.random_uniform(shape=()) |
| 119 | b = random_ops.random_uniform(shape=()) |
| 120 | c = a + b |
| 121 | train_op = ops.get_collection_ref(ops.GraphKeys.TRAIN_OP) |
| 122 | train_op.append(c) |
| 123 | mg = meta_graph.create_meta_graph_def(graph=g) |
| 124 | grappler_item = item.Item(mg) |
| 125 | |
| 126 | with cluster.Provision( |
| 127 | disable_detailed_stats=False, disable_timeline=False) as gcluster: |
| 128 | op_perfs, run_time, step_stats = gcluster.MeasureCosts(grappler_item) |
| 129 | self.assertTrue(run_time > 0) |
| 130 | self.assertEqual(len(op_perfs), 4) |
| 131 | self.assertTrue(step_stats.dev_stats) |
| 132 | |
| 133 | def testAvailableOps(self): |
| 134 | with cluster.Provision() as gcluster: |
nothing calls this directly
no test coverage detected