/external/tensorflow/tensorflow/core/grappler/utils/ |
D | graph_view.cc | 36 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 …]
|
D | pattern_utils.cc | 28 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 …]
|
D | pattern_utils.h | 148 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()
|
D | graph_view.h | 51 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 …]
|
D | graph_view_internal.h | 65 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 …]
|
D | graph_view_test.cc | 233 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 …]
|
D | graph_view_internal_test.cc | 47 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/ |
D | remapper.cc | 380 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 …]
|
D | implementation_selector.cc | 118 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 …]
|
D | generic_layout_optimizer.cc | 44 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 …]
|
D | generic_layout_optimizer_transposer.cc | 129 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 …]
|
D | implementation_selector.h | 117 Status MaybeOptimizeFunctionCall(utils::MutableNodeView* node_view) const;
|
D | generic_layout_optimizer_test.cc | 205 EXPECT_EQ(fanin.node_view()->GetName(), fanin_name); in VerifyRegularFaninMatch() 213 if (regular_fanout.node_view()->GetName() == fanout_name && in VerifyRegularFanoutMatch()
|
D | generic_layout_optimizer_transposer_test.cc | 78 EXPECT_EQ(fanin.node_view()->GetName(), fanin_name); in VerifyRegularFaninMatch()
|