diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-07-26 22:11:20 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-07-26 22:15:29 -0700 |
commit | dd1f0cdddbfb3104e390026184474d4374f52642 (patch) | |
tree | 6bd1f58a74e4ba771f99e104ce874c0a98a51ffc /tensorflow/core/util/device_name_utils.h | |
parent | 631a364cd1ddd822cf4b8712a5388d5ea39ecd7e (diff) |
Supports lookup devices by fullname either in the canonical form or the
legacy form. This makes DeviceSet behaves the same as DeviceMgr's
FindDevice method.
PiperOrigin-RevId: 163300346
Diffstat (limited to 'tensorflow/core/util/device_name_utils.h')
-rw-r--r-- | tensorflow/core/util/device_name_utils.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tensorflow/core/util/device_name_utils.h b/tensorflow/core/util/device_name_utils.h index 1f32828bae..740aa13fa7 100644 --- a/tensorflow/core/util/device_name_utils.h +++ b/tensorflow/core/util/device_name_utils.h @@ -152,6 +152,11 @@ class DeviceNameUtils { static bool SplitDeviceName(StringPiece name, string* task, string* device); static string ParsedNameToString(const ParsedName& pn); + + // Returns canonical and legacy full names for the given parsed + // device name 'pn'. The returned string names are often useful to + // lookup devices from a mapping. + static std::vector<string> GetNamesForDeviceMappings(const ParsedName& pn); }; } // namespace tensorflow |