/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 | 58 const OpTypePattern& pattern, MutableNodeView* node_view, in DoesOpTypePatternMatch() argument 61 if (node_view->NumControllingFanins() > 0 || in DoesOpTypePatternMatch() 62 node_view->NumControlledFanouts() > 0) in DoesOpTypePatternMatch() 73 if (node_view->node()->op() == op) { in DoesOpTypePatternMatch() 88 node_label_to_index_[pattern.label] = node_view->node_index(); in DoesOpTypePatternMatch() 90 matched_node_indices_.insert(node_view->node_index()); in DoesOpTypePatternMatch() 92 remove_node_indices_.insert(node_view->node_index()); in DoesOpTypePatternMatch() 94 } else if (node_label_to_index_[pattern.label] != node_view->node_index()) { in DoesOpTypePatternMatch() 97 DCHECK(node_label_to_index_[pattern.label] == node_view->node_index()); in DoesOpTypePatternMatch() 103 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() 187 MutableNodeView* node_view, 199 MutableNodeView* node_view, NodeViewMatch* match); 208 auto node_view = graph_view_->GetNode(node_idx); in IsSafeNodesToRemove() local 210 string node_name = node_view->GetName(); in IsSafeNodesToRemove() 216 auto fanouts_by_ports = node_view->GetRegularFanouts(); in IsSafeNodesToRemove()
|
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 | 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 | remapper.cc | 549 inline bool HasControlFaninOrFanout(const utils::MutableNodeView& node_view) { in HasControlFaninOrFanout() argument 550 return node_view.NumControllingFanins() > 0 || in HasControlFaninOrFanout() 551 node_view.NumControlledFanouts() > 0; in HasControlFaninOrFanout() 555 inline bool HasAtMostOneFanoutAtPort0(const utils::MutableNodeView& node_view) { in HasAtMostOneFanoutAtPort0() argument 556 return node_view.GetRegularFanout(0).size() <= 1; in HasAtMostOneFanoutAtPort0() 562 const utils::MutableNodeView& node_view) { in HasAtMostOneDataFanoutAtPort0() argument 564 const NodeDef* node = fanout.node_view()->node(); in HasAtMostOneDataFanoutAtPort0() 567 return absl::c_count_if(node_view.GetRegularFanout(0), predicate) <= 1; in HasAtMostOneDataFanoutAtPort0() 578 const utils::MutableNodeView& node_view, in IsBiasSemanticAdd() argument 582 const auto* node_def = node_view.node(); in IsBiasSemanticAdd() [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 ()() 131 auto* node_view = context->graph_view->GetNode(i); in ExpandLayoutSensitiveOp() local 132 auto* node_def = node_view->node(); in ExpandLayoutSensitiveOp() 143 TF_RETURN_IF_ERROR(transposer->TransposeNode(context, node_view)); in ExpandLayoutSensitiveOp() 153 auto* node_view = context->graph_view->GetNode(i); in ExpandLayoutAgnosticOp() local 154 auto* node_def = node_view->node(); in ExpandLayoutAgnosticOp() 164 TF_RETURN_IF_ERROR(transposer->TransposeNode(context, node_view)); in ExpandLayoutAgnosticOp() 246 auto* fanin_node = regular_fanin_0.node_view(); in EraseCancellableNodes() 256 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 ()() 379 auto* fanin_node_view = fanin_port.node_view(); in UpdateFaninEdgesWithOp() 432 src_node, fanout.node_view())); in UpdateFanoutEdgesWithOp() 587 return GetFanoutPortRank(*regular_fanin.node_view(), regular_fanin.index()); in GetFaninPortRank() 602 const auto* fanin_node_view = regular_fanin.node_view(); in IsFaninPortDimsNIfConst() 845 auto* fanin_node = fanin.node_view(); in TransposeNode() 992 auto* data_fanin_node = data_fanin.node_view(); in TransposeNode() 1101 auto* fanin_node = fanin.node_view(); in IsAfterDstToSrcTransform() 1119 auto* fanin_node = fanin.node_view(); in IsAfterDstToSrcTransform() [all …]
|
D | implementation_selector.h | 113 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()
|