Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/api/paddle/Overview_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ tensor 属性相关
" :ref:`paddle.is_integer <cn_api_paddle_is_integer>` ", "判断输入 tensor 的数据类型是否为整数类型"
" :ref:`paddle.broadcast_shape <cn_api_paddle_broadcast_shape>` ", "返回对 x_shape 大小的 Tensor 和 y_shape 大小的 Tensor 做 broadcast 操作后得到的 shape"
" :ref:`paddle.is_floating_point <cn_api_paddle_is_floating_point>` ", "判断输入 Tensor 的数据类型是否为浮点类型"
" :ref:`paddle.Size <cn_api_paddle_Size>` ", "tuple 的子类, paddle.Tensor.size() 的返回类型,用于描述张量的维度大小。"

.. _tensor_creation:

Expand Down
21 changes: 21 additions & 0 deletions docs/api/paddle/Size_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. _cn_api_paddle_Size:

Size
-------------------------------

.. py:class:: paddle.Size()

``paddle.Tensor.size()`` 的返回类型,用于描述张量的维度大小。作为 ``tuple`` 的子类,支持所有常见的序列操作(如索引、切片、拼接等)。

**参数**
:::::::::
- ``*args``:表示维度的整数序列或多个整数参数。

**返回**
:::::::::
- ``Size``:表示张量维度的特殊元组子类。

**代码示例**
:::::::::

COPY-FROM: paddle.Size
7 changes: 7 additions & 0 deletions docs/api/paddle/Tensor_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,13 @@ data
**代码示例**
COPY-FROM: paddle.Tensor.data

is_cuda
:::::::::

如果 Tensor 存储在 GPU 上,则为 True,否则为 False。

**代码示例**
COPY-FROM: paddle.Tensor.is_cuda

numpy()
:::::::::
Expand Down