diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-06-04 21:37:43 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-06-04 21:40:04 -0700 |
commit | fedfc47ca6713adbbf82e10d4803c5fe94234bbd (patch) | |
tree | e850bb2086549706092770a683f5e5667db407b5 /tensorflow/contrib/distribute/python/values.py | |
parent | 76801dda9b4766d729ab88267ee47f48d05eafb7 (diff) |
Resolve device names when passed into DistributionStrategy methods.
PiperOrigin-RevId: 199241723
Diffstat (limited to 'tensorflow/contrib/distribute/python/values.py')
-rw-r--r-- | tensorflow/contrib/distribute/python/values.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tensorflow/contrib/distribute/python/values.py b/tensorflow/contrib/distribute/python/values.py index 49b4e24daa..9572ade8e4 100644 --- a/tensorflow/contrib/distribute/python/values.py +++ b/tensorflow/contrib/distribute/python/values.py @@ -65,9 +65,10 @@ class DistributedValues(object): device = device_util.canonicalize(device) try: return self._index[device] - except KeyError: - raise ValueError("Device %s not found in %s (current device %s)" % - (device, self._index.keys(), device_util.current())) + except KeyError as e: + six.raise_from( + ValueError("Device %s not found in %s (current device %s)" % + (device, self._index.keys(), device_util.current())), e) def on_device(self, device): device = device_util.canonicalize(device) |