Skip to content

Commit fbd8dfe

Browse files
Revert: [NFC] Move the function to filter out common stack trace to a common util header
PiperOrigin-RevId: 352019621 Change-Id: Iefd77428751d721657a638478f2c5bd851085368
1 parent 4bb669c commit fbd8dfe

3 files changed

Lines changed: 9 additions & 11 deletions

File tree

‎tensorflow/core/util/BUILD‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,6 @@ cc_library(
481481
],
482482
deps = [
483483
"//tensorflow/core/platform:status",
484-
"@com_google_absl//absl/strings",
485484
],
486485
)
487486

‎tensorflow/core/util/managed_stack_trace.h‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ limitations under the License.
1818

1919
#include <string>
2020

21-
#include "absl/strings/match.h"
2221
#include "tensorflow/core/platform/status.h"
2322

2423
namespace tensorflow {
@@ -34,15 +33,6 @@ using ToStackFramesFunctor = std::vector<StackFrame>(int, const StackTraceMap&,
3433
const StackTraceFilter&,
3534
bool, int);
3635

37-
// Returns whether the given frame is internal to TF.
38-
inline bool IsInternalFrameForFilename(absl::string_view file_name) {
39-
// Use a simple heuristic for now.
40-
// TODO(cheshire): Build a more sophisticated mechanism, rely on @tf.export.
41-
return absl::StrContains(file_name, "tensorflow/python") &&
42-
!absl::StrContains(file_name, "keras") &&
43-
!absl::StrContains(file_name, "test.py");
44-
}
45-
4636
// Language agnostic stack trace class. It only saves an id, and language
4737
// clients are responsible for managing the actual stack trace objects.
4838
class ManagedStackTrace {

‎tensorflow/python/util/tf_stack.cc‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,15 @@ class StackTraceWrapper : public AbstractStackTrace {
226226
});
227227
}
228228

229+
static bool IsInternalFrameForFilename(absl::string_view file_name) {
230+
// Use a simple heuristic for now.
231+
// TODO(cheshire): Build a more sophisticated mechanism, rely on @tf.export.
232+
return (absl::StrContains(file_name, "tensorflow/python") ||
233+
absl::StrContains(file_name, "tensorflow\\python")) &&
234+
!absl::StrContains(file_name, "keras") &&
235+
!absl::StrContains(file_name, "test.py");
236+
}
237+
229238
absl::optional<StackFrame> StackTraceMapping(SourceLoc loc) const {
230239
if (source_map_->contains(loc)) {
231240
return source_map_->at(loc);

0 commit comments

Comments
 (0)