From f54a0447e187f25cead1bbcca04c6ab981db6a72 Mon Sep 17 00:00:00 2001 From: saishruthi Date: Thu, 9 May 2019 10:25:53 -0700 Subject: [PATCH 1/3] minor code change --- tensorflow/python/framework/device_spec.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tensorflow/python/framework/device_spec.py b/tensorflow/python/framework/device_spec.py index 83e517c2ae4..19591c03d46 100644 --- a/tensorflow/python/framework/device_spec.py +++ b/tensorflow/python/framework/device_spec.py @@ -356,6 +356,15 @@ class DeviceSpecV2(object): return output def __eq__(self, other): + """Checks if two known `DeviceSpec`s are same. + + Args: + other: Another DeviceSpec + + Returns: + Returns `True` if other DeviceSpec and this DeviceSpec belong to the same class and + have same values. If not, returns `False`. + """ return (isinstance(other, self.__class__) and self.to_string() == other.to_string()) From 042dfc3a49ae2131e16c8e0ed394321344f648dd Mon Sep 17 00:00:00 2001 From: saishruthi Date: Fri, 10 May 2019 09:52:27 -0700 Subject: [PATCH 2/3] minor doc change --- tensorflow/python/framework/device_spec.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tensorflow/python/framework/device_spec.py b/tensorflow/python/framework/device_spec.py index 19591c03d46..a8aa4165259 100644 --- a/tensorflow/python/framework/device_spec.py +++ b/tensorflow/python/framework/device_spec.py @@ -356,14 +356,15 @@ class DeviceSpecV2(object): return output def __eq__(self, other): - """Checks if two known `DeviceSpec`s are same. + """Checks if the `other` DeviceSpec is same as the current instance, eg have + same value for all the internal fields. Args: other: Another DeviceSpec Returns: - Returns `True` if other DeviceSpec and this DeviceSpec belong to the same class and - have same values. If not, returns `False`. + Return `True` if `other` is also a DeviceSpec instance and has same value as the current instance. + Return False otherwise. """ return (isinstance(other, self.__class__) and self.to_string() == other.to_string()) From 65eb41d394f34cf2109a4993217500576122e9cf Mon Sep 17 00:00:00 2001 From: saishruthi Date: Fri, 10 May 2019 09:53:10 -0700 Subject: [PATCH 3/3] minor doc change --- tensorflow/python/framework/device_spec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/python/framework/device_spec.py b/tensorflow/python/framework/device_spec.py index a8aa4165259..49781625b60 100644 --- a/tensorflow/python/framework/device_spec.py +++ b/tensorflow/python/framework/device_spec.py @@ -364,7 +364,7 @@ class DeviceSpecV2(object): Returns: Return `True` if `other` is also a DeviceSpec instance and has same value as the current instance. - Return False otherwise. + Return `False` otherwise. """ return (isinstance(other, self.__class__) and self.to_string() == other.to_string())