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

Function CompareNodeFanins

tensorflow/core/grappler/mutable_graph_view_test.cc:36–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34using FDH = FunctionDefHelper;
35
36void CompareNodeFanins(const MutableGraphView& graph, NodeDef* node,
37 absl::Span<const string> fanins) {
38 ASSERT_EQ(node->input_size(), fanins.size());
39 for (int i = 0; i < node->input_size(); ++i) {
40 TensorId tensor_id = ParseTensorName(fanins[i]);
41 EXPECT_EQ(ParseTensorName(node->input(i)), tensor_id);
42 int port;
43 if (tensor_id.index() == Graph::kControlSlot) {
44 port = Graph::kControlSlot;
45 } else {
46 port = i;
47 }
48 MutableGraphView::InputPort input_port(node, port);
49 MutableGraphView::OutputPort output_port =
50 graph.GetOutputPort(tensor_id.node(), tensor_id.index());
51 EXPECT_TRUE(graph.GetFanin(input_port).contains(output_port));
52 EXPECT_TRUE(graph.GetFanout(output_port).contains(input_port));
53 }
54}
55
56void CompareNodeFanouts(const MutableGraphView& graph, NodeDef* node,
57 absl::Span<const string> fanouts) {

Callers 11

CheckNodeFunction · 0.85
TestUpdateNodeNameFunction · 0.85
TestAddRegularFaninFunction · 0.85
TestRemoveRegularFaninFunction · 0.85
TestRemoveAllFaninsFunction · 0.85
TestUpdateFaninFunction · 0.85

Calls 9

ParseTensorNameFunction · 0.85
GetOutputPortMethod · 0.80
containsMethod · 0.80
input_sizeMethod · 0.45
sizeMethod · 0.45
inputMethod · 0.45
indexMethod · 0.45
nodeMethod · 0.45
GetFaninMethod · 0.45

Tested by

no test coverage detected