未验证 提交 2ab60c30 编写于 作者: 2 201716010711 提交者: GitHub

delete rank api (#48217)

上级 161998f7
......@@ -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):
"""
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册