tpu_estimator gives us unstable input shapes when inputs are labeled with names....
authorYunxing Dai <yunxing@google.com>
Tue, 6 Mar 2018 22:36:36 +0000 (14:36 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Tue, 6 Mar 2018 22:40:15 +0000 (14:40 -0800)
PiperOrigin-RevId: 188082738

tensorflow/contrib/tpu/python/tpu/tpu_estimator.py

index a7991eb..f3c2a51 100644 (file)
@@ -784,7 +784,8 @@ class _InputPipeline(object):
       def _extract_key_names(tensor_or_dict):
         if tensor_or_dict is None:
           return []
-        return tensor_or_dict.keys() if isinstance(tensor_or_dict, dict) else []
+        return sorted(tensor_or_dict.keys()) if isinstance(
+            tensor_or_dict, dict) else []
 
       # Extract structure.
       has_labels = labels is not None