From 9ece30ba7cb218ccd469972d9030bdfb15b64ccf Mon Sep 17 00:00:00 2001 From: Zhoulong Jiang Date: Fri, 4 Dec 2020 10:03:11 +0000 Subject: [PATCH] address comments --- tensorflow/c/c_api_experimental.h | 6 ++++-- tensorflow/python/eager/context.py | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tensorflow/c/c_api_experimental.h b/tensorflow/c/c_api_experimental.h index b6cb3268063..4ab56e8adb8 100644 --- a/tensorflow/c/c_api_experimental.h +++ b/tensorflow/c/c_api_experimental.h @@ -305,7 +305,9 @@ TF_ImportGraphDefOptionsSetValidateColocationConstraints( TF_ImportGraphDefOptions* opts, unsigned char enable); // Load the library specified by library_filename and register the pluggable -// device and related kernels present in that library. +// device and related kernels present in that library. This function should work +// on all the platforms supported by TensorFlow, apart from embedded/mobile +// platforms. // // Pass "library_filename" to a platform-specific mechanism for dynamically // loading a library. The rules for determining the exact location of the @@ -314,7 +316,7 @@ TF_ImportGraphDefOptionsSetValidateColocationConstraints( // On success, place OK in status and return the newly created library handle. // The caller owns the library handle. // -// On failure, place an error status in status and return NULL. +// On failure, return nullptr and places an error status in status. TF_CAPI_EXPORT extern TF_Library* TF_LoadPluggableDeviceLibrary( const char* library_filename, TF_Status* status); diff --git a/tensorflow/python/eager/context.py b/tensorflow/python/eager/context.py index 3e32d05be64..a034e9efe8c 100644 --- a/tensorflow/python/eager/context.py +++ b/tensorflow/python/eager/context.py @@ -1243,7 +1243,12 @@ class Context(object): self._thread_local_data.invoking_op_callbacks = value def _initialize_physical_devices(self, reinitialize=False): - """Get local devices visible to the system.""" + """Get local devices visible to the system. + + Args: + reinitialize: This flag will reinitialize self._physical_devices so that + dynamic registered devices will also be visible to the python front-end. + """ # We lazy initialize self._physical_devices since we do not want to do this # the constructor since the backend may not be initialized yet. with self._device_lock: