tensorflow/python/util/tf_stack.cc
// Converts the given stack frame to string, according to options defined in
// `opts`.
Converts the given stack frame to string, according to options defined in
`opts`.
Converts the given stack frame to string according to options defined in ` opts ` .
std::string StackFrameToString(
    const StackFrame& frame,
    const AbstractStackTrace::TracePrintingOptions& opts,
    int shared_prefix_size = 0) {
  std::string out = absl::StrFormat(
      "File \"%s\", line %d, in %s",
      absl::StrContains(frame.file_name, kFilenameToIgnorePrefix)
          ? frame.file_name
          : frame.file_name.substr(shared_prefix_size),
      frame.line_number, frame.function_name);
  if (opts.show_line_contents) {
    PyGILState_STATE state = PyGILState_Ensure();
    std::string line_contents = std::string(LineContents(frame));
    PyGILState_Release(state);
    if (!line_contents.empty()) {
      absl::StrAppend(&out, "\n  ", line_contents);
    }
  }
  return out;
}
std :: string StackFrameToString ( const StackFrame & frame , const AbstractStackTrace :: TracePrintingOptions & opts , int shared_prefix_size = 0 ) { std :: string out = absl :: StrFormat ( " \" \" " , absl :: StrContains ( frame . file_name , kFilenameToIgnorePrefix ) ? frame . file_name : frame . file_name . substr ( shared_prefix_size ) , frame . line_number , frame . function_name ) ; if ( opts . show_line_contents ) { PyGILState_STATE state = PyGILState_Ensure ( ) ; std :: string line_contents = std :: string ( LineContents ( frame ) ) ; PyGILState_Release ( state ) ; if ( ! line_contents . empty ( ) ) { absl :: StrAppend ( & out , " \n " , line_contents ) ; } } return out ; }
Converts the given stack frame to string, according to options defined in
`opts`.
Converts the given stack frame to string according to options defined in ` opts ` .