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

Function GetRootFrame

tensorflow/compiler/jit/deadness_analysis.cc:1078–1095  ·  view source on GitHub ↗

If the node is inside some frames, get the name of the outermost non-empty frame. Otherwise, get an empty frame name.

Source from the content-addressed store, hash-verified

1076// If the node is inside some frames, get the name of the outermost non-empty
1077// frame. Otherwise, get an empty frame name.
1078Status GetRootFrame(const Node* n, absl::Span<const ControlFlowInfo> cfi_infos,
1079 absl::string_view* frame) {
1080 int depth = 0;
1081 const ControlFlowInfo* cfi_iter = &cfi_infos[n->id()];
1082 while (!cfi_iter->parent_frame->IsSource()) {
1083 n = cfi_iter->parent_frame;
1084 cfi_iter = &cfi_infos[n->id()];
1085
1086 if (depth++ > 5000) {
1087 return errors::Internal(
1088 "Frame of depth > 5000: Probably malformed graph or a bug in "
1089 "BuildControlFlowInfo");
1090 }
1091 }
1092
1093 *frame = cfi_iter->frame_name;
1094 return Status::OK();
1095}
1096} // namespace
1097
1098Status DeadnessAnalysisImpl::HandleMerge(Node* n,

Callers 1

PopulateMethod · 0.85

Calls 3

InternalFunction · 0.85
IsSourceMethod · 0.80
idMethod · 0.45

Tested by

no test coverage detected