diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index 3f66af243d97da7abb9eca8d493bc8a2b4765622..96ca8a459bd5002be46c01289e85c4c68bc4055b 100644 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -145,7 +145,6 @@ __all__ = [ 'slice', 'strided_slice', 'shape', - 'rank', 'size', 'logical_and', 'logical_or', @@ -10467,34 +10466,6 @@ def shape(input): return out -def rank(input): - """ - - The OP returns the number of dimensions for a tensor, which is a 0-D int32 Tensor. - - Args: - input (Tensor): The input N-D tensor with shape of :math:`[N_1, N_2, ..., N_k]`, the data type is arbitrary. - - Returns: - Tensor, the output data type is int32.: The 0-D tensor with the dimensions of the input Tensor. - - Examples: - .. code-block:: python - - import paddle - - input = paddle.rand((3, 100, 100)) - rank = paddle.rank(input) - print(rank) - # 3 - """ - check_type(input, 'input', (Variable), 'input') - ndims = len(input.shape) - out = assign(np.array(ndims, 'int32')) - - return out - - @deprecated(since="2.0.0", update_to="paddle.numel") def size(input): """