MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / testBasic

Method testBasic

tensorflow/python/grappler/cluster_test.py:34–49  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

32class 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:

Callers

nothing calls this directly

Calls 8

MeasureCostsMethod · 0.95
random_uniformMethod · 0.80
get_collection_refMethod · 0.80
ItemMethod · 0.80
as_defaultMethod · 0.45
GraphMethod · 0.45
appendMethod · 0.45
ClusterMethod · 0.45

Tested by

no test coverage detected