Skip to content

Commit b6ab86a

Browse files
skyetensorflower-gardener
authored andcommitted
Revert behavior when TPU_LOAD_LIBRARY isn't set
PiperOrigin-RevId: 451467858
1 parent 6348e32 commit b6ab86a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tensorflow/core/tpu/tpu_initializer_helper.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,14 @@ Status TryAcquireTpuLock() {
131131
static absl::Mutex* mu = new absl::Mutex();
132132
absl::MutexLock l(mu);
133133

134+
// TODO(skyewm): use `absl::StrCat(getenv(name))` once we build with the
135+
// fix for https://github.com/abseil/abseil-cpp/issues/1167.
136+
std::string load_library_override;
134137
const char* env_value = getenv("TPU_LOAD_LIBRARY");
135-
if (!env_value) {
136-
return errors::FailedPrecondition(
137-
"TPU_LOAD_LIBRARY environment variable not defined");
138+
if (env_value != nullptr) {
139+
load_library_override = std::string(env_value);
138140
}
139141

140-
std::string load_library_override = absl::StrCat(env_value);
141-
142142
if (load_library_override == "1") {
143143
return Status::OK();
144144
} else if (load_library_override == "0") {

0 commit comments

Comments
 (0)