From 18a7a327f37b58b250d89190fe3cda9fa9372fab Mon Sep 17 00:00:00 2001 From: Swapnil Parekh Date: Wed, 20 May 2020 19:13:15 +0530 Subject: [PATCH] Update tpu_strategy.py rank[DEP] -> ndim --- tensorflow/python/distribute/tpu_strategy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/python/distribute/tpu_strategy.py b/tensorflow/python/distribute/tpu_strategy.py index b574c523ccd..a8ffa618064 100644 --- a/tensorflow/python/distribute/tpu_strategy.py +++ b/tensorflow/python/distribute/tpu_strategy.py @@ -897,7 +897,7 @@ class TPUExtended(distribute_lib.StrategyExtendedV1): if tensor_util.is_tensor(input_tensor): rank = input_tensor.get_shape().rank else: - rank = np.rank(input_tensor) + rank = np.ndim(input_tensor) maximum_shape = tensor_shape.TensorShape([None] * rank) maximum_shapes.append(maximum_shape) maximum_shapes = nest.pack_sequence_as(replicate_inputs[0],