(self)
| 60 | self.assertItemsEqual(['Const', 'Const_1', 'add'], op_list) |
| 61 | |
| 62 | def testOpProperties(self): |
| 63 | with ops.Graph().as_default() as g: |
| 64 | a = constant_op.constant(10) |
| 65 | b = constant_op.constant(20) |
| 66 | c = a + b |
| 67 | z = control_flow_ops.no_op() |
| 68 | train_op = ops.get_collection_ref(ops.GraphKeys.TRAIN_OP) |
| 69 | train_op.append(c) |
| 70 | mg = meta_graph.create_meta_graph_def(graph=g) |
| 71 | grappler_item = item.Item(mg) |
| 72 | op_properties = grappler_item.GetOpProperties() |
| 73 | |
| 74 | # All the nodes in this model have one scalar output |
| 75 | for node in grappler_item.metagraph.graph_def.node: |
| 76 | node_prop = op_properties[node.name] |
| 77 | |
| 78 | if node.name == z.name: |
| 79 | self.assertEqual(0, len(node_prop)) |
| 80 | else: |
| 81 | self.assertEqual(1, len(node_prop)) |
| 82 | self.assertEqual(dtypes.int32, node_prop[0].dtype) |
| 83 | self.assertEqual(tensor_shape.TensorShape([]), node_prop[0].shape) |
| 84 | |
| 85 | def testUpdates(self): |
| 86 | with ops.Graph().as_default() as g: |
nothing calls this directly
no test coverage detected