Skip to content

Commit 96ee932

Browse files
loisloGoogle-ML-Automation
authored andcommitted
Migrate deprecated tsl::errors to absl equivalents.
PiperOrigin-RevId: 872924754
1 parent 26afee8 commit 96ee932

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

third_party/tsl/tsl/profiler/lib/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ cc_library(
152152
"@xla//xla/tsl/profiler:xla_internal",
153153
]),
154154
deps = [
155+
"@com_google_absl//absl/status",
155156
"@com_google_absl//absl/status:statusor",
156157
"@com_google_absl//absl/strings:string_view",
157158
"@xla//xla/tsl/platform:errors",

third_party/tsl/tsl/profiler/lib/profiler_lock.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ limitations under the License.
1616

1717
#include <atomic>
1818

19+
#include "absl/status/status.h"
1920
#include "absl/status/statusor.h"
2021
#include "xla/tsl/platform/errors.h"
2122
#include "xla/tsl/platform/macros.h"
@@ -49,13 +50,13 @@ static_assert(ATOMIC_INT_LOCK_FREE == 2, "Assumed atomic<int> was lock free");
4950
return disabled;
5051
}();
5152
if (TF_PREDICT_FALSE(tf_profiler_disabled)) {
52-
return errors::AlreadyExists(
53+
return absl::AlreadyExistsError(
5354
"TensorFlow Profiler is permanently disabled by env var "
5455
"TF_DISABLE_PROFILING.");
5556
}
5657
int already_active = g_session_active.exchange(1, std::memory_order_acq_rel);
5758
if (already_active) {
58-
return errors::AlreadyExists(kProfilerLockContention);
59+
return absl::AlreadyExistsError(kProfilerLockContention);
5960
}
6061
return ProfilerLock(/*active=*/true);
6162
}

0 commit comments

Comments
 (0)