/external/tensorflow/tensorflow/core/grappler/ |
D | graph_topology_view_test.cc | 57 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 …]
|
D | graph_view.cc | 66 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 …]
|
D | graph_view_test.cc | 42 GraphView graph_view(&graph_def); in TEST_F() local 44 const NodeDef& a_node_def = *graph_view.GetNode("a"); in TEST_F() 45 const NodeDef& b_node_def = *graph_view.GetNode("b"); in TEST_F() 77 GraphView graph_view(&graph_def); in TEST_F() local 79 const NodeDef& b_node_def = *graph_view.GetNode("b"); in TEST_F() 109 GraphView graph_view(&graph_def); in TEST_F() local 111 const NodeDef& c_node_def = *graph_view.GetNode("c"); in TEST_F() 303 GraphView graph_view(&graph_def); in BM_GraphViewConstruction() local 342 GraphView graph_view(&graph_def); in BM_GraphViewGetNode() local 345 graph_view.GetNode("out"); in BM_GraphViewGetNode() [all …]
|
D | BUILD | 92 ":graph_view", 108 ":graph_view", 116 name = "graph_view", 117 srcs = ["graph_view.cc"], 118 hdrs = ["graph_view.h"], 137 ":graph_view", 231 ":graph_view",
|
/external/tensorflow/tensorflow/core/grappler/utils/ |
D | graph_view_test.cc | 67 TypeParam graph_view(&graph, &s); in TYPED_TEST() local 79 TypeParam graph_view(&graph, &s); in TYPED_TEST() local 90 TypeParam graph_view(&graph, &s); in TYPED_TEST() local 103 TypeParam graph_view(&graph, &s); in TYPED_TEST() local 115 TypeParam graph_view(&graph, &s); in TYPED_TEST() local 118 const int num_nodes = graph_view.NumNodes(); in TYPED_TEST() 119 ASSERT_EQ(graph_view.NumNodes(), graph.node_size()); in TYPED_TEST() 121 const auto* node = graph_view.GetNode(i); in TYPED_TEST() 126 const auto* bad_node = graph_view.GetNode(-1); in TYPED_TEST() 128 bad_node = graph_view.GetNode(num_nodes); in TYPED_TEST() [all …]
|
D | graph_view_internal_test.cc | 44 const MutableGraphView* graph_view) { in GetUpdatedNodeNames() argument 46 updated_node_names.reserve(graph_view->NumNodes()); in GetUpdatedNodeNames() 47 for (const auto& node_view : graph_view->GetNodes()) { in GetUpdatedNodeNames() 59 MutableGraphView graph_view(&graph, &s); in TEST() local 61 auto updated_node_names = GetUpdatedNodeNames(&graph_view); in TEST() 63 MutableNodeView* d_node = graph_view.GetNode("d"); in TEST() 66 MutableNodeViewDiff diff(&graph_view, d_node->node_index()); in TEST() 83 MutableGraphView graph_view(&graph, &s); in TEST() local 85 auto updated_node_names = GetUpdatedNodeNames(&graph_view); in TEST() 87 MutableNodeView* d_node = graph_view.GetNode("d"); in TEST() [all …]
|
D | pattern_utils_test.cc | 169 MutableGraphView graph_view(&graph, &status); in TEST_F() local 171 TF_EXPECT_OK(graph_view.SortTopologically(/*ignore_cycles=*/false, {})); in TEST_F() 172 auto root_node_view = graph_view.GetNode("e"); in TEST_F() 174 SubGraphMatcher<MatchingDirection::kFollowInputs> graph_matcher(&graph_view); in TEST_F() 189 int expected_node_idx = graph_view.GetNode(label)->node_index(); in TEST_F() 251 MutableGraphView graph_view(&graph, &status); in TEST_F() local 253 TF_EXPECT_OK(graph_view.SortTopologically(/*ignore_cycles=*/false, {})); in TEST_F() 254 auto root_node_view = graph_view.GetNode("e"); in TEST_F() 256 SubGraphMatcher<MatchingDirection::kFollowInputs> graph_matcher(&graph_view); in TEST_F() 271 int expected_node_idx = graph_view.GetNode(label)->node_index(); in TEST_F() [all …]
|
D | traversal.cc | 45 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 …]
|
D | traversal_test.cc | 56 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 …]
|
D | frame.cc | 31 inline Status FrameView::InferFromGraphViewT(const GraphViewT& graph_view) { in InferFromGraphViewT() argument 40 for (const auto& node : graph_view.GetNodes()) { in InferFromGraphViewT() 47 const auto* graph = graph_view.graph(); in InferFromGraphViewT() 120 const auto* ready_node_view = graph_view.GetNode(ready_node_index); in InferFromGraphViewT() 144 Status FrameView::InferFromGraphView(const utils::GraphView& graph_view) { in InferFromGraphView() argument 145 return InferFromGraphViewT(graph_view); in InferFromGraphView() 149 const utils::MutableGraphView& graph_view) { in InferFromGraphView() argument 150 return InferFromGraphViewT(graph_view); in InferFromGraphView() 155 utils::GraphView graph_view(&graph, &status); in InferFromGraph() local 157 return InferFromGraphViewT(graph_view); in InferFromGraph()
|
D | topological_sort.cc | 53 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 const int max_size = graph_view.GetFanin(fanout).size(); in ComputeTopologicalOrder() 93 if (back != graph_view.num_nodes()) { in ComputeTopologicalOrder() 98 for (int i = 0; i < graph_view.num_nodes(); ++i) { in ComputeTopologicalOrder() 99 const int max_size = graph_view.GetFanin(i).size(); in ComputeTopologicalOrder()
|
D | graph_view.h | 48 FaninView(GraphView* graph_view, int node_index, int port_index) in FaninView() argument 49 : NodeIndexAndPortIndex(graph_view, node_index, port_index) {} in FaninView() 65 FanoutView(GraphView* graph_view, int node_index, int port_index) in FanoutView() argument 66 : NodeIndexAndPortIndex(graph_view, node_index, port_index) {} in FanoutView() 82 explicit NodeView(GraphView* graph_view, int node_index) in NodeView() argument 83 : NodeViewInternal(graph_view, node_index) {} in NodeView() 143 MutableFaninView(MutableGraphView* graph_view, int node_index, int port_index) in MutableFaninView() argument 144 : NodeIndexAndPortIndex(graph_view, node_index, port_index) {} in MutableFaninView() 146 explicit MutableFaninView(MutableGraphView* graph_view, int node_index, in MutableFaninView() argument 148 : NodeIndexAndPortIndex(graph_view, node_index, port_index), in MutableFaninView() [all …]
|
D | graph_view_internal.h | 49 NodeIndexAndPortIndex(GraphViewT* graph_view, int node_index, int port_index) in NodeIndexAndPortIndex() argument 50 : graph_view_(graph_view), in NodeIndexAndPortIndex() 130 explicit NodeViewInternal(GraphViewT* graph_view, int node_index) in NodeViewInternal() argument 131 : graph_view_(graph_view), in NodeViewInternal() 133 attrs_(AttrSlice(graph_view->graph()->node(node_index))) {} in NodeViewInternal() 366 explicit NodeViewDiff(GraphViewT* graph_view, int node_index) in NodeViewDiff() 367 : graph_view(graph_view), node_index(node_index) {} in NodeViewDiff() 369 GraphViewT* graph_view; member 405 if (diff->graph_view->GetNode(diff->node_index)->GetName() == name) { in UpdateName() 419 if (diff->graph_view->GetNode(diff->node_index)->GetOp() == op) { in UpdateOp() [all …]
|
D | frame.h | 42 Status InferFromGraphView(const utils::GraphView& graph_view); 45 Status InferFromGraphView(const utils::MutableGraphView& graph_view); 62 inline Status InferFromGraphViewT(const GraphViewT& graph_view);
|
D | BUILD | 66 "//tensorflow/core/grappler:graph_view", 93 ":graph_view", 108 ":graph_view", 346 ":graph_view", 358 name = "graph_view", 359 srcs = ["graph_view.cc"], 360 hdrs = ["graph_view.h"], 382 ":graph_view", 401 ":graph_view",
|
/external/tensorflow/tensorflow/core/grappler/optimizers/ |
D | generic_layout_optimizer_transposer_test.cc | 405 auto* c2d = context.graph_view->GetNode("conv2d"); in ReduceTransposerKeepDims() 410 auto* sum = context.graph_view->GetNode("sum"); in ReduceTransposerKeepDims() 414 auto* input_transpose_node = context.graph_view->GetNode( in ReduceTransposerKeepDims() 418 auto* updated_sum_node = context.graph_view->GetNode("sum"); in ReduceTransposerKeepDims() 424 auto* axis_node = context.graph_view->GetNode( in ReduceTransposerKeepDims() 430 auto* output_transpose_node = context.graph_view->GetNode( in ReduceTransposerKeepDims() 434 auto* z_output_node = context.graph_view->GetNode("z"); in ReduceTransposerKeepDims() 472 auto* c2d = context.graph_view->GetNode("conv2d"); in ReduceTransposerValidAxisNode() 477 auto* max = context.graph_view->GetNode("max"); in ReduceTransposerValidAxisNode() 481 auto* input_transpose_node = context.graph_view->GetNode( in ReduceTransposerValidAxisNode() [all …]
|
D | generic_layout_optimizer_test.cc | 243 utils::GraphView graph_view(&output, &status); in TEST_F() local 247 auto* input_transpose_node = graph_view.GetNode( in TEST_F() 255 auto* conv2d_node = graph_view.GetNode("Conv2D"); in TEST_F() 262 auto* output_transpose_node = graph_view.GetNode( in TEST_F() 269 auto* output_node = graph_view.GetNode("Output"); in TEST_F() 288 utils::GraphView graph_view(&output, &status); in TEST_F() local 290 auto* conv_node = graph_view.GetNode("Conv2D"); in TEST_F() 307 utils::GraphView graph_view(&output, &status); in TEST_F() local 309 auto* conv_node = graph_view.GetNode("Conv2D"); in TEST_F() 330 utils::GraphView graph_view(&output, &status); in TEST_F() local [all …]
|
D | model_pruner.cc | 38 bool IsTrivialIdentity(const NodeDef& node, const GraphView& graph_view) { in IsTrivialIdentity() argument 40 graph_view.GetFanins(node, /*include_controlling_nodes=*/true)) { in IsTrivialIdentity() 49 graph_view.GetFanouts(node, /*include_controlled_nodes=*/true)) { in IsTrivialIdentity() 60 bool IsTrivialOp(const NodeDef& node, const GraphView& graph_view) { in IsTrivialOp() argument 67 return IsTrivialIdentity(node, graph_view); in IsTrivialOp() 75 graph_view.NumFanouts(node, /*include_controlled_nodes=*/false) == 0) { in IsTrivialOp() 82 const GraphView& graph_view) { in RemovalIncreasesEdgeCount() argument 84 graph_view.NumFanins(node, /*include_controlling_nodes=*/true); in RemovalIncreasesEdgeCount() 86 graph_view.NumFanouts(node, /*include_controlled_nodes=*/true); in RemovalIncreasesEdgeCount() 104 bool CanRemoveNode(const NodeDef& node, const GraphView& graph_view, in CanRemoveNode() argument [all …]
|
D | generic_layout_optimizer.cc | 78 for (const auto& node : context.graph_view->GetNodes()) { in NumConvOnDeviceWithDataTypeOverThreshold() 124 auto* node_view = context->graph_view->GetNode(i); in ExpandLayoutSensitiveOp() 146 auto* node_view = context->graph_view->GetNode(i); in ExpandLayoutAgnosticOp() 229 utils::MutableGraphView* graph_view = context->graph_view.get(); in EraseCancellableNodes() local 230 utils::Mutation* mutation = graph_view->GetMutationBuilder(); in EraseCancellableNodes() 231 const int num_nodes = graph_view->NumNodes(); in EraseCancellableNodes() 234 auto* node = graph_view->GetNode(i); in EraseCancellableNodes() 275 utils::MutableGraphView* graph_view = context->graph_view.get(); in EraseCancellableNodesAroundPad() local 276 utils::Mutation* mutation = graph_view->GetMutationBuilder(); in EraseCancellableNodesAroundPad() 280 const int num_nodes = graph_view->NumNodes(); in EraseCancellableNodesAroundPad() [all …]
|
D | generic_layout_optimizer_transposer.cc | 234 context->graph_view = in InitializeTransposeContext() 294 auto* graph_view = context->graph_view.get(); in CreateConstPermNode() local 295 DCHECK(!graph_view->HasNode(node_name)); in CreateConstPermNode() 320 graph_view->GetMutationBuilder()->AddNode(std::move(node), &status); in CreateConstPermNode() 331 auto* graph_view = context->graph_view.get(); in CreateTransposeNode() local 332 DCHECK(!graph_view->HasNode(node_name)); in CreateTransposeNode() 371 graph_view->GetMutationBuilder()->AddNode(std::move(node), &status); in CreateTransposeNode() 412 context->graph_view->GetMutationBuilder()->AddOrUpdateNodeAttr( in UpdateFanoutEdgesWithOp() 446 auto* graph_view = context->graph_view.get(); in CreateDataFormatNode() local 447 DCHECK(!graph_view->HasNode(node_name)); in CreateDataFormatNode() [all …]
|
D | remapper.cc | 81 graph_view(&item->graph, status), in RemapperContext() 86 utils::MutableGraphView graph_view; member 305 const NodeDef& node = ctx.graph_view.graph()->node(matched.contraction); in IsCpuCompatibleDataType() 331 const GraphDef* graph = ctx.graph_view.graph(); in IsCpuCompatibleDataType() 404 const auto* node_view = ctx.graph_view.GetNode(node_index); in IsCpuCompatibleDataType() 444 const auto* node_view = ctx.graph_view.GetNode(node_index); in IsCpuCompatibleDataType() 492 const auto* node_view = ctx.graph_view.GetNode(node_index); in IsCpuCompatibleDataType() 547 const auto* node_view = ctx.graph_view.GetNode(node_index); in IsCpuCompatibleDataType() 596 const auto* node_view = ctx.graph_view.GetNode(node_index); in IsCpuCompatibleDataType() 614 ctx.graph_view.GetNode(base.fused_batch_norm); in IsCpuCompatibleDataType() [all …]
|
D | implementation_selector.cc | 342 utils::MutableGraphView graph_view(graph, &status); in SelectDeviceIndex() local 344 const int num_nodes = graph_view.NumNodes(); in SelectDeviceIndex() 346 auto* node_view = graph_view.GetNode(k); in SelectDeviceIndex() 385 utils::MutableGraphView graph_view(graph, &status); in SelectImplementation() local 388 const int num_nodes = graph_view.NumNodes(); in SelectImplementation() 390 TF_RETURN_IF_ERROR(MaybeOptimizeFunctionCall(graph_view.GetNode(k))); in SelectImplementation()
|
D | loop_optimizer.cc | 456 const GraphTopologyView& graph_view, in GetStackPushNodesToConvert() argument 458 VLOG(1) << "Stack node: " << graph_view.graph()->node(stack_node_idx).name(); in GetStackPushNodesToConvert() 470 DfsTraversal(graph_view, {graph_view.GetNode(stack_node_idx)}, in GetStackPushNodesToConvert() 474 const absl::optional<int> idx = graph_view.GetNodeIndex(*node); in GetStackPushNodesToConvert() 479 const NodeDef& fanout_node = graph_view.graph()->node(fanout_idx); in GetStackPushNodesToConvert() 486 if (graph_view.HasNode(fanout_node.input(0))) { in GetStackPushNodesToConvert() 487 const NodeDef* stack_node = graph_view.GetNode(fanout_node.input(0)); in GetStackPushNodesToConvert() 490 graph_view.HasNode(stack_node->input(0))) { in GetStackPushNodesToConvert() 491 stack_node = graph_view.GetNode(stack_node->input(0)); in GetStackPushNodesToConvert() 505 (!graph_view.GetFanout(fanout_idx).empty() || in GetStackPushNodesToConvert() [all …]
|
/external/tensorflow/tensorflow/python/training/tracking/ |
D | util.py | 55 from tensorflow.python.training.tracking import graph_view as graph_view_lib 183 restore_op_cache, graph_view, options): argument 230 self.graph_view = graph_view 717 def __init__(self, checkpoint, feed_dict, graph_view): argument 720 self._graph_view = graph_view 722 self._root = graph_view.root 888 def __init__(self, graph_view, restore_uid): argument 890 self._graph_view = graph_view 892 self._root = graph_view.root 965 def __init__(self, checkpoint, graph_view): argument [all …]
|
/external/tensorflow/tensorflow/core/kernels/data/experimental/ |
D | compute_batch_size_op.cc | 103 grappler::GraphView graph_view(&graph_def); in Compute() local 105 const NodeDef* node = graph_view.GetNode(dataset_node_name); in Compute() 108 int64 batch_size = GetBatchSize(*node, graph_view); in Compute()
|