MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetInputPreds

Method GetInputPreds

tensorflow/compiler/jit/deadness_analysis.cc:900–928  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

898}
899
900Status DeadnessAnalysisImpl::GetInputPreds(
901 Node* n, DeadnessAnalysisImpl::EdgeKind edge_kind,
902 std::vector<Predicate*>* result) {
903 result->clear();
904 for (const Edge* in_edge : n->in_edges()) {
905 bool should_process =
906 edge_kind == EdgeKind::kDataAndControl ||
907 (in_edge->IsControlEdge() && edge_kind == EdgeKind::kControlOnly) ||
908 (!in_edge->IsControlEdge() && edge_kind == EdgeKind::kDataOnly);
909
910 if (should_process) {
911 auto it = predicate_map_.find(InputEdgeToTensorId(in_edge));
912 if (it == predicate_map_.end()) {
913 GraphCycles graph_cycles;
914 TF_RETURN_IF_ERROR(
915 CreateCycleDetectionGraph(&graph_, &graph_cycles).status());
916
917 // If we didn't return with an error above then the graph is probably
918 // fine and we have a bug in deadness analysis.
919 return errors::Internal("Could not find input ", in_edge->DebugString(),
920 " to ", n->name(),
921 " when visiting the graph in post-order. Most "
922 "likely indicates a bug in deadness analysis.");
923 }
924 result->push_back(it->second);
925 }
926 }
927 return Status::OK();
928}
929
930Status DeadnessAnalysisImpl::HandleSwitch(Node* n,
931 std::vector<bool>* should_revisit) {

Callers

nothing calls this directly

Calls 11

InputEdgeToTensorIdFunction · 0.85
InternalFunction · 0.85
nameMethod · 0.65
clearMethod · 0.45
IsControlEdgeMethod · 0.45
findMethod · 0.45
endMethod · 0.45
statusMethod · 0.45
DebugStringMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected