Home
last modified time | relevance | path

Searched refs:graph_view (Results 1 – 25 of 32) sorted by relevance

12

/external/tensorflow/tensorflow/core/grappler/
Dgraph_topology_view_test.cc57 GraphTopologyView graph_view; in TEST_F() local
58 TF_CHECK_OK(graph_view.InitializeFromGraph(graph)); in TEST_F()
60 EXPECT_TRUE(graph_view.is_initialized()); in TEST_F()
62 const NodeDef* a_by_name = graph_view.GetNode("a"); in TEST_F()
63 const NodeDef* a_by_idx = graph_view.GetNode(0); in TEST_F()
68 const NodeDef* b_by_name = graph_view.GetNode("b"); in TEST_F()
69 const NodeDef* b_by_idx = graph_view.GetNode(1); in TEST_F()
74 const absl::optional<int> b_idx = graph_view.GetNodeIndex(*b_by_name); in TEST_F()
78 const absl::optional<int> c_idx = graph_view.GetNodeIndex("c"); in TEST_F()
83 EXPECT_EQ(graph_view.GetFanin(0), Fanin()); in TEST_F()
[all …]
Dgraph_view.cc66 bool HasSingleFanoutNode(const GraphView& graph_view, const NodeDef* node, in HasSingleFanoutNode() argument
69 return graph_view.GetFanout(output).size() <= 1; in HasSingleFanoutNode()
72 bool HasFanouts(const GraphView& graph_view, const NodeDef* node, int port) { in HasFanouts() argument
74 return !graph_view.GetFanout(output).empty(); in HasFanouts()
77 bool HasControlFanin(const GraphView& graph_view, const NodeDef* node) { in HasControlFanin() argument
79 return !graph_view.GetFanin(control_port).empty(); in HasControlFanin()
82 bool HasControlFanout(const GraphView& graph_view, const NodeDef* node) { in HasControlFanout() argument
84 return !graph_view.GetFanout(control_port).empty(); in HasControlFanout()
87 bool HasControlFaninOrFanout(const GraphView& graph_view, const NodeDef* node) { in HasControlFaninOrFanout() argument
88 return HasControlFanin(graph_view, node) || in HasControlFaninOrFanout()
[all …]
Dgraph_view_test.cc41 GraphView graph_view(&graph_def); in TEST_F() local
43 const NodeDef& a_node_def = *graph_view.GetNode("a"); in TEST_F()
44 const NodeDef& b_node_def = *graph_view.GetNode("b"); in TEST_F()
76 GraphView graph_view(&graph_def); in TEST_F() local
78 const NodeDef& b_node_def = *graph_view.GetNode("b"); in TEST_F()
108 GraphView graph_view(&graph_def); in TEST_F() local
110 const NodeDef& c_node_def = *graph_view.GetNode("c"); in TEST_F()
302 GraphView graph_view(&graph_def); in BM_GraphViewConstruction() local
341 GraphView graph_view(&graph_def); in BM_GraphViewGetNode() local
345 graph_view.GetNode("out"); in BM_GraphViewGetNode()
[all …]
DBUILD72 ":graph_view",
88 ":graph_view",
96 name = "graph_view",
97 srcs = ["graph_view.cc"],
98 hdrs = ["graph_view.h"],
117 ":graph_view",
210 ":graph_view",
Dgraph_view.h410 bool HasSingleFanoutNode(const GraphView& graph_view, const NodeDef* node,
414 bool HasFanouts(const GraphView& graph_view, const NodeDef* node, int port = 0);
416 bool HasControlFanin(const GraphView& graph_view, const NodeDef* node);
418 bool HasControlFanout(const GraphView& graph_view, const NodeDef* node);
420 bool HasControlFaninOrFanout(const GraphView& graph_view, const NodeDef* node);
/external/tensorflow/tensorflow/core/grappler/utils/
Dtraversal.cc45 void DfsTraversal(const GraphTopologyView& graph_view, in DfsTraversal() argument
54 const absl::optional<int> node_idx = graph_view.GetNodeIndex(*node); in DfsTraversal()
70 if (predicates.enter && !predicates.enter(graph_view.GetNode(w.node))) { in DfsTraversal()
79 callbacks.post_order(graph_view.GetNode(w.node)); in DfsTraversal()
87 callbacks.on_back_edge(graph_view.GetNode(w.src), in DfsTraversal()
88 graph_view.GetNode(w.node)); in DfsTraversal()
95 callbacks.pre_order(graph_view.GetNode(w.node)); in DfsTraversal()
102 if (predicates.advance && !predicates.advance(graph_view.GetNode(w.node))) { in DfsTraversal()
108 for (const int fanin : graph_view.GetFanin(w.node)) { in DfsTraversal()
112 for (const int fanout : graph_view.GetFanout(w.node)) { in DfsTraversal()
[all …]
Dtraversal_test.cc56 GraphTopologyView graph_view; in TEST() local
57 TF_CHECK_OK(graph_view.InitializeFromGraph(graph)); in TEST()
58 DfsTraversal(graph_view, start_nodes, TraversalDirection::kFollowOutputs, in TEST()
87 GraphTopologyView graph_view; in TEST() local
88 TF_CHECK_OK(graph_view.InitializeFromGraph(graph)); in TEST()
89 DfsTraversal(graph_view, start_nodes, TraversalDirection::kFollowInputs, in TEST()
117 GraphTopologyView graph_view; in TEST() local
118 TF_CHECK_OK(graph_view.InitializeFromGraph(graph)); in TEST()
119 DfsTraversal(graph_view, start_nodes, TraversalDirection::kFollowInputs, in TEST()
148 GraphTopologyView graph_view; in TEST() local
[all …]
Dtopological_sort.cc53 GraphTopologyView graph_view; in ComputeTopologicalOrder() local
54 TF_RETURN_IF_ERROR(graph_view.InitializeFromGraph( in ComputeTopologicalOrder()
67 if (graph_view.GetFanin(i).empty()) { in ComputeTopologicalOrder()
72 for (int input : graph_view.GetFanin(i)) { in ComputeTopologicalOrder()
82 for (int fanout : graph_view.GetFanout(ready_node)) { in ComputeTopologicalOrder()
84 if (num_ready_inputs[fanout] == graph_view.GetFanin(fanout).size()) { in ComputeTopologicalOrder()
92 if (back != graph_view.num_nodes()) { in ComputeTopologicalOrder()
Dframe.cc29 Status FrameView::InferFromGraphView(const GraphView& graph_view) { in InferFromGraphView() argument
38 for (const NodeDef& node : graph_view.graph()->node()) { in InferFromGraphView()
53 graph_view.GetFanouts(*ready_node, /*include_controlled_nodes=*/true); in InferFromGraphView()
Dtraversal.h88 void DfsTraversal(const GraphTopologyView& graph_view,
96 void DfsTraversal(const GraphTopologyView& graph_view,
Dframe.h43 Status InferFromGraphView(const GraphView& graph_view);
DBUILD52 "//tensorflow/core/grappler:graph_view",
82 "//tensorflow/core/grappler:graph_view",
/external/tensorflow/tensorflow/core/grappler/optimizers/
Dmodel_pruner.cc37 const MutableGraphView& graph_view) { in IsTrivialIdentity() argument
39 graph_view.GetFanins(node, /*include_controlling_nodes=*/true)) { in IsTrivialIdentity()
48 graph_view.GetFanouts(node, /*include_controlled_nodes=*/true)) { in IsTrivialIdentity()
59 bool IsTrivialOp(const NodeDef& node, const MutableGraphView& graph_view) { in IsTrivialOp() argument
66 return IsTrivialIdentity(node, graph_view); in IsTrivialOp()
73 const MutableGraphView& graph_view) { in RemovalIncreasesEdgeCount() argument
75 graph_view.NumFanins(node, /*include_controlling_nodes=*/true); in RemovalIncreasesEdgeCount()
77 graph_view.NumFanouts(node, /*include_controlling_nodes=*/true); in RemovalIncreasesEdgeCount()
95 bool CanRemoveNode(const NodeDef& node, const MutableGraphView& graph_view, in CanRemoveNode() argument
98 if (RemovalIncreasesEdgeCount(node, graph_view)) { in CanRemoveNode()
[all …]
Dremapper.cc52 graph_view(&item.graph), in RemapperContext()
57 GraphView graph_view; member
236 HasControlFaninOrFanout(ctx.graph_view, bias_add)) in FindConv2DWithBias()
241 const auto conv2d = ctx.graph_view.GetRegularFanin(input_port); in FindConv2DWithBias()
245 HasControlFaninOrFanout(ctx.graph_view, conv2d.node) || in FindConv2DWithBias()
246 !HasSingleFanoutNode(ctx.graph_view, conv2d.node) || in FindConv2DWithBias()
267 if (!relu || !IsRelu(*relu) || HasControlFaninOrFanout(ctx.graph_view, relu)) in FindConv2DWithBiasAndRelu()
272 const auto bias_add = ctx.graph_view.GetRegularFanin(input_port); in FindConv2DWithBiasAndRelu()
277 !HasSingleFanoutNode(ctx.graph_view, base.bias_add) || in FindConv2DWithBiasAndRelu()
299 HasControlFaninOrFanout(ctx.graph_view, bias_add)) in FindConv2DWithSqueezeAndBias()
[all …]
Dloop_optimizer.cc457 const GraphTopologyView& graph_view, in GetStackPushNodesToConvert() argument
459 VLOG(1) << "Stack node: " << graph_view.graph()->node(stack_node_idx).name(); in GetStackPushNodesToConvert()
471 DfsTraversal(graph_view, {graph_view.GetNode(stack_node_idx)}, in GetStackPushNodesToConvert()
475 const absl::optional<int> idx = graph_view.GetNodeIndex(*node); in GetStackPushNodesToConvert()
480 const NodeDef& fanout_node = graph_view.graph()->node(fanout_idx); in GetStackPushNodesToConvert()
487 if (graph_view.HasNode(fanout_node.input(0))) { in GetStackPushNodesToConvert()
488 const NodeDef* stack_node = graph_view.GetNode(fanout_node.input(0)); in GetStackPushNodesToConvert()
491 graph_view.HasNode(stack_node->input(0))) { in GetStackPushNodesToConvert()
492 stack_node = graph_view.GetNode(stack_node->input(0)); in GetStackPushNodesToConvert()
506 (!graph_view.GetFanout(fanout_idx).empty() || in GetStackPushNodesToConvert()
[all …]
Dfunction_optimizer.cc311 const GraphView& graph_view() const { return graph_view_; } in graph_view() function in tensorflow::grappler::__anondd39c0ba0111::FunctionOptimizerContext
497 ctx.graph_view().GetFanoutEdges(node, /*include_controlled_edges=*/false); in GetActiveOutputs()
1511 ctx->graph_view().GetRegularFanin({&func_node, input_idx}); in PlaceInlinedFunctionBody()
1602 ctx->graph_view().GetInputPort(func_node.name(), Graph::kControlSlot); in InlineIndirectFunctionCall()
1604 ctx->graph_view().GetOutputPort(func_node.name(), Graph::kControlSlot); in InlineIndirectFunctionCall()
1609 ctx->graph_view().GetFanin(control_input_port), in InlineIndirectFunctionCall()
1619 ctx->graph_view().GetFanout(control_output_port), in InlineIndirectFunctionCall()
Dmemory_optimizer.cc1273 GraphTopologyView graph_view; in RelaxAllocatorConstraints() local
1274 TF_RETURN_IF_ERROR(graph_view.InitializeFromGraph( in RelaxAllocatorConstraints()
1289 DfsTraversal(graph_view, {graph_view.GetNode(i)}, in RelaxAllocatorConstraints()
1324 graph_view.GetNodeIndex(*assign_node_in_fanout); in RelaxAllocatorConstraints()
/external/tensorflow/tensorflow/python/training/tracking/
Dutil.py47 from tensorflow.python.training.tracking import graph_view as graph_view_lib
60 restore_op_cache, graph_view): argument
104 self.graph_view = graph_view
532 def __init__(self, checkpoint, feed_dict, graph_view): argument
535 self._graph_view = graph_view
679 def __init__(self, graph_view, restore_uid): argument
681 self._graph_view = graph_view
754 def __init__(self, checkpoint, graph_view): argument
756 self._graph_view = graph_view
858 def __init__(self, graph_view): argument
[all …]
DBUILD109 name = "graph_view",
110 srcs = ["graph_view.py"],
132 ":graph_view",
164 ":graph_view",
226 ":graph_view",
Dutil_test.py50 from tensorflow.python.training.tracking import graph_view
139 graph_view.ObjectGraphView(obj).serialize_object_graph())
287 named_variables, serialized_graph, _ = graph_view.ObjectGraphView(
668 (named_variable,), _, _ = graph_view.ObjectGraphView(
690 (named_variable,), _, _ = graph_view.ObjectGraphView(
701 (named_variable,), _, _ = graph_view.ObjectGraphView(
1474 graph_view.ObjectGraphView(root))
/external/tensorflow/tensorflow/python/keras/saving/
Dsaved_model.py41 from tensorflow.python.training.tracking import graph_view
204 var_list, _, _ = graph_view.ObjectGraphView(model).serialize_object_graph()
/external/tensorflow/tensorflow/python/saved_model/
Dload.py37 from tensorflow.python.training.tracking import graph_view
186 saver = util.TrackableSaver(graph_view.ObjectGraphView(self.get(0)))
DBUILD315 "//tensorflow/python/training/tracking:graph_view",
360 "//tensorflow/python/training/tracking:graph_view",
Dsave.py51 from tensorflow.python.training.tracking import graph_view
67 class _AugmentedGraphView(graph_view.ObjectGraphView):
/external/tensorflow/tensorflow/core/grappler/optimizers/data/
Dfusion_utils.cc264 MutableGraphView graph_view(&graph); in CreateFalsePredicate() local
265 auto* node = graph_utils::AddScalarConstNode(false, &graph_view); in CreateFalsePredicate()

12