Merge pull request #12963 from linux-on-ibm-z/TensorFlow_PR_Rank

Cover the numpy-ndarray bug on s390x
This commit is contained in:
Shanqing Cai 2017-09-18 11:38:02 -04:00 committed by GitHub
commit 66eed36466

View File

@ -626,7 +626,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