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

Method testImportantOps

tensorflow/python/grappler/item_test.py:50–60  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

48 item.Item(mg)
49
50 def testImportantOps(self):
51 with ops.Graph().as_default() as g:
52 a = constant_op.constant(10)
53 b = constant_op.constant(20)
54 c = a + b
55 train_op = ops.get_collection_ref(ops.GraphKeys.TRAIN_OP)
56 train_op.append(c)
57 mg = meta_graph.create_meta_graph_def(graph=g)
58 grappler_item = item.Item(mg)
59 op_list = grappler_item.IdentifyImportantOps()
60 self.assertItemsEqual(['Const', 'Const_1', 'add'], op_list)
61
62 def testOpProperties(self):
63 with ops.Graph().as_default() as g:

Callers

nothing calls this directly

Calls 7

IdentifyImportantOpsMethod · 0.95
get_collection_refMethod · 0.80
ItemMethod · 0.80
as_defaultMethod · 0.45
GraphMethod · 0.45
constantMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected