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.
This commit is contained in:
Shahid 2017-09-11 16:52:13 +05:30 committed by GitHub
parent 702d595822
commit 76ad78c6dd

View File

@ -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