diff --git a/tensorflow/c/c_api_experimental.cc b/tensorflow/c/c_api_experimental.cc index cfbc6717ff0..9d484efc412 100644 --- a/tensorflow/c/c_api_experimental.cc +++ b/tensorflow/c/c_api_experimental.cc @@ -766,12 +766,14 @@ TF_Library* TF_LoadPluggableDeviceLibrary(const char* library_filename, #else TF_Library* lib_handle = new TF_Library; static tensorflow::mutex mu(tensorflow::LINKER_INITIALIZED); - static std::unordered_map loaded_libs; + static std::unordered_map* loaded_libs = + new std::unordered_map(); tensorflow::Env* env = tensorflow::Env::Default(); { tensorflow::mutex_lock lock(mu); - if (loaded_libs.find(library_filename) != loaded_libs.end()) { - lib_handle->lib_handle = loaded_libs[library_filename]; + auto it = loaded_libs->find(library_filename); + if (it != loaded_libs->end()) { + lib_handle->lib_handle = it->second; } else { status->status = env->LoadDynamicLibrary(library_filename, &lib_handle->lib_handle); diff --git a/tensorflow/c/experimental/stream_executor/test/test_pluggable_device.cc b/tensorflow/c/experimental/stream_executor/test/test_pluggable_device.cc index 8151aba6b65..d985f3ca83b 100644 --- a/tensorflow/c/experimental/stream_executor/test/test_pluggable_device.cc +++ b/tensorflow/c/experimental/stream_executor/test/test_pluggable_device.cc @@ -1,4 +1,3 @@ - /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License");