From 76ad78c6dddb138fee523c80f2701ef3ca56b316 Mon Sep 17 00:00:00 2001 From: Shahid Date: Mon, 11 Sep 2017 16:52:13 +0530 Subject: [PATCH] Fix numpy-ndarray bug On zSystems, the ndarray is not retaining the values for nparray. Defining the data type is required to get the desired behavior. --- tensorflow/python/framework/tensor_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/python/framework/tensor_util.py b/tensorflow/python/framework/tensor_util.py index 745428e530c..34e4c66e580 100644 --- a/tensorflow/python/framework/tensor_util.py +++ b/tensorflow/python/framework/tensor_util.py @@ -627,7 +627,7 @@ def _ConstantValue(tensor, partial): elif tensor.op.type == "Rank": input_shape = tensor.op.inputs[0].get_shape() if input_shape.ndims is not None: - return np.ndarray(shape=(), buffer=np.array([input_shape.ndims]), + return np.ndarray(shape=(), buffer=np.array([input_shape.ndims], dtype=np.int32), dtype=np.int32) else: return None