Home
last modified time | relevance | path

Searched refs:node_view (Results 1 – 14 of 14) sorted by relevance

/external/tensorflow/tensorflow/core/grappler/utils/
Dgraph_view.cc36 FaninView::FaninView(NodeView* node_view, int index) in FaninView() argument
37 : NodeIndexAndPortIndex(node_view->graph_view_, node_view->node_index_, in FaninView()
40 FanoutView::FanoutView(NodeView* node_view, int index) in FanoutView() argument
41 : NodeIndexAndPortIndex(node_view->graph_view_, node_view->node_index_, in FanoutView()
61 NodeView* view = fanout.node_view(); in HasFanout()
99 for (NodeView& node_view : nodes_) { in GraphView()
100 s = CheckAndAddFaninsInternal(&node_view); in GraphView()
120 Status GraphView::CheckAndAddFaninsInternal(NodeView* node_view) { in CheckAndAddFaninsInternal() argument
122 const NodeDef* node = node_view->node(); in CheckAndAddFaninsInternal()
124 const int node_index = node_view->node_index_; in CheckAndAddFaninsInternal()
[all …]
Dpattern_utils.cc28 const OpTypePattern& pattern, MutableNodeView* node_view, in DoesOpTypePatternMatch() argument
31 if (node_view->NumControllingFanins() > 0 || in DoesOpTypePatternMatch()
32 node_view->NumControlledFanouts() > 0) in DoesOpTypePatternMatch()
43 if (node_view->node()->op() == op) { in DoesOpTypePatternMatch()
58 node_label_to_index_[pattern.label] = node_view->node_index(); in DoesOpTypePatternMatch()
60 matched_node_indices_.insert(node_view->node_index()); in DoesOpTypePatternMatch()
62 remove_node_indices_.insert(node_view->node_index()); in DoesOpTypePatternMatch()
64 } else if (node_label_to_index_[pattern.label] != node_view->node_index()) { in DoesOpTypePatternMatch()
67 DCHECK(node_label_to_index_[pattern.label] == node_view->node_index()); in DoesOpTypePatternMatch()
73 match->node_view = node_view; in DoesOpTypePatternMatch()
[all …]
Dpattern_utils.h148 MutableNodeView* node_view = nullptr; member
153 if (node_view == nullptr) { in DebugString()
157 result += node_view->node()->DebugString(); in DebugString()
172 if (node_view != nullptr) { in Clear()
173 node_view = nullptr; in Clear()
185 bool GetMatchedNodes(const OpTypePattern& pattern, MutableNodeView* node_view,
197 MutableNodeView* node_view, NodeViewMatch* match);
205 auto node_view = graph_view_->GetNode(node_idx); in HasRemoveNodeExternalDependents() local
210 auto fanouts_by_ports = node_view->GetRegularFanouts(); in HasRemoveNodeExternalDependents()
Dgraph_view.h51 FaninView(NodeView* node_view, int index);
68 FanoutView(NodeView* node_view, int index);
123 Status CheckAndAddFaninsInternal(NodeView* node_view);
154 MutableFaninView(MutableNodeView* node_view, int index);
187 MutableFanoutView(MutableNodeView* node_view, int index);
494 inline void RemoveRegularFaninFanoutInternal(MutableNodeView* node_view,
497 inline void AddRegularFaninInternal(MutableNodeView* node_view,
500 inline void UpdateRegularFaninInternal(MutableNodeView* node_view,
504 inline void RemoveControllingFaninFanoutInternal(MutableNodeView* node_view,
508 MutableNodeView* node_view, const std::set<int>& indices_to_remove);
[all …]
Dgraph_view_internal.h65 NodeViewT* node_view() const { in node_view() function
495 auto* node_view = diff->graph_view->GetNode(diff->node_index); in AddOrUpdateRegularFanin() local
496 const int num_regular_fanins = node_view->NumRegularFanins(); in AddOrUpdateRegularFanin()
510 const auto& existing_fanin = node_view->GetRegularFanin(index); in AddOrUpdateRegularFanin()
512 existing_fanin.node_view()->GetName() != fanin.node()) { in AddOrUpdateRegularFanin()
537 auto* node_view = diff->graph_view->GetNode(diff->node_index); in RemoveRegularFanin() local
538 const int num_regular_fanins = node_view->NumRegularFanins(); in RemoveRegularFanin()
616 auto* node_view = diff->graph_view->GetNode(diff->node_index); in RemoveAttribute() local
617 if (node_view->HasAttr(attr_name)) { in RemoveAttribute()
696 auto* node_view = diff->graph_view->GetNode(diff->node_index); in IsWellFormed() local
[all …]
Dgraph_view_test.cc233 ASSERT_NE(d_control_fanins[0].node_view(), nullptr); in TEST()
234 EXPECT_EQ(d_control_fanins[0].node_view()->GetName(), "c"); in TEST()
235 ASSERT_NE(d_control_fanins[1].node_view(), nullptr); in TEST()
236 EXPECT_EQ(d_control_fanins[1].node_view()->GetName(), "b"); in TEST()
237 ASSERT_NE(d_control_fanins[2].node_view(), nullptr); in TEST()
238 EXPECT_EQ(d_control_fanins[2].node_view()->GetName(), "a"); in TEST()
253 const auto* node_view = graph_view.GetNode(node.name()); in TYPED_TEST() local
254 ASSERT_NE(node_view, nullptr); in TYPED_TEST()
255 EXPECT_EQ(node_view->GetName(), node.name()); in TYPED_TEST()
256 EXPECT_EQ(node_view->GetName(), node_view->node()->name()); in TYPED_TEST()
[all …]
Dgraph_view_internal_test.cc47 for (const auto& node_view : graph_view->GetNodes()) { in GetUpdatedNodeNames() local
48 updated_node_names.emplace(node_view.GetName(), -1); in GetUpdatedNodeNames()
/external/tensorflow/tensorflow/core/grappler/optimizers/
Dremapper.cc380 inline bool HasControlFaninOrFanout(const utils::MutableNodeView& node_view) { in IsCpuCompatibleDataType() argument
381 return node_view.NumControllingFanins() > 0 || in IsCpuCompatibleDataType()
382 node_view.NumControlledFanouts() > 0; in IsCpuCompatibleDataType()
386 inline bool HasAtMostOneFanoutAtPort0(const utils::MutableNodeView& node_view) { in IsCpuCompatibleDataType() argument
387 return node_view.GetRegularFanout(0).size() <= 1; in IsCpuCompatibleDataType()
393 const utils::MutableNodeView& node_view) { in IsCpuCompatibleDataType() argument
395 const NodeDef* node = fanout.node_view()->node(); in IsCpuCompatibleDataType()
398 return absl::c_count_if(node_view.GetRegularFanout(0), predicate) <= 1; in IsCpuCompatibleDataType()
404 const auto* node_view = ctx.graph_view.GetNode(node_index); in IsCpuCompatibleDataType() local
407 if (HasControlFaninOrFanout(*node_view)) return false; in IsCpuCompatibleDataType()
[all …]
Dimplementation_selector.cc118 if (IsIdentity(*input.node_view()->node())) { in FindForwardNode()
120 return input.node_view()->node()->input(0); in FindForwardNode()
121 } else if (IsPartitionedCall(*input.node_view()->node()) || in FindForwardNode()
122 IsStatefulPartitionedCall(*input.node_view()->node())) { in FindForwardNode()
137 if ("Identity" == fanout.node_view()->GetOp()) { in UpdateForwardIdentityNodeDtype()
138 (*fanout.node_view()->node()->mutable_attr())["T"].set_type( in UpdateForwardIdentityNodeDtype()
141 << fanout.node_view()->node()->DebugString(); in UpdateForwardIdentityNodeDtype()
147 Status UpdateNodeDef(utils::MutableNodeView* node_view, const string& funcName, in UpdateNodeDef() argument
149 NodeDef* node_def = node_view->node(); in UpdateNodeDef()
199 const string last_input = FindForwardNode(node_view); in UpdateNodeDef()
[all …]
Dgeneric_layout_optimizer.cc44 void operator()(std::string* out, utils::MutableNodeView* node_view) const { in operator ()()
45 absl::StrAppend(out, node_view->node()->name()); in operator ()()
124 auto* node_view = context->graph_view->GetNode(i); in ExpandLayoutSensitiveOp() local
125 auto* node_def = node_view->node(); in ExpandLayoutSensitiveOp()
136 TF_RETURN_IF_ERROR(transposer->TransposeNode(context, node_view)); in ExpandLayoutSensitiveOp()
146 auto* node_view = context->graph_view->GetNode(i); in ExpandLayoutAgnosticOp() local
147 auto* node_def = node_view->node(); in ExpandLayoutAgnosticOp()
157 TF_RETURN_IF_ERROR(transposer->TransposeNode(context, node_view)); in ExpandLayoutAgnosticOp()
239 auto* fanin_node = regular_fanin_0.node_view(); in EraseCancellableNodes()
249 TensorId fanin_id_to_forward(fanin_to_forward.node_view()->GetName(), in EraseCancellableNodes()
[all …]
Dgeneric_layout_optimizer_transposer.cc129 auto* node1_view = node1.node_view(); in operator ()()
130 auto* node2_view = node2.node_view(); in operator ()()
382 auto* fanin_node_view = fanin_port.node_view(); in UpdateFaninEdgesWithOp()
435 src_node, fanout.node_view())); in UpdateFanoutEdgesWithOp()
592 return GetFanoutPortRank(*regular_fanin.node_view(), regular_fanin.index()); in GetFaninPortRank()
607 const auto* fanin_node_view = regular_fanin.node_view(); in IsFaninPortDimsNIfConst()
850 auto* fanin_node = fanin.node_view(); in TransposeNode()
997 auto* data_fanin_node = data_fanin.node_view(); in TransposeNode()
1106 auto* fanin_node = fanin.node_view(); in IsAfterDstToSrcTransform()
1124 auto* fanin_node = fanin.node_view(); in IsAfterDstToSrcTransform()
[all …]
Dimplementation_selector.h117 Status MaybeOptimizeFunctionCall(utils::MutableNodeView* node_view) const;
Dgeneric_layout_optimizer_test.cc205 EXPECT_EQ(fanin.node_view()->GetName(), fanin_name); in VerifyRegularFaninMatch()
213 if (regular_fanout.node_view()->GetName() == fanout_name && in VerifyRegularFanoutMatch()
Dgeneric_layout_optimizer_transposer_test.cc78 EXPECT_EQ(fanin.node_view()->GetName(), fanin_name); in VerifyRegularFaninMatch()