Skip to content

Commit 7915c2b

Browse files
[API Compatibility] add tensor_split API alias (PaddlePaddle#7418)
* fix(API Compatibility): add tensor_split API alias * Update docs/api/paddle/tensor_split_cn.rst --------- Co-authored-by: zachary sun <[email protected]>
1 parent f7d7fc8 commit 7915c2b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docs/api/paddle/tensor_split_cn.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ tensor_split
1919
参数
2020
:::::::::
2121
- **x** (Tensor) - 输入变量,数据类型为 bool、bfloat16、float16、float32、float64、uint8、int8、int32、int64 的多维 Tensor,其维度必须大于 0。
22+
别名: ``input``
2223
- **num_or_indices** (int|list|tuple) - 如果 ``num_or_indices`` 是一个整数 ``n`` ,则 ``x`` 沿 ``axis`` 拆分为 ``n`` 部分。如果 ``x`` 可被 ``n`` 整除,则每个部分都是 ``x.shape[axis]/n`` 。如果 ``x`` 不能被 ``n`` 整除,则前 ``int(x.shape[axis]%n)`` 个部分的大小将是 ``int(x.shape[axis]/n)+1`` ,其余部分的大小将是 ``int(x.shape[axis]/n)`` 。如果 ``num_or_indices`` 是整数索引的列表或元组,则在每个索引处沿 ``axis`` 分割 ``x`` 。例如, ``num_or_indices=[2, 4]`` 在 ``axis=0`` 时将沿轴 0 将 ``x`` 拆分为 ``x[:2]`` 、 ``x[2:4]`` 和 ``x[4:]`` 。
24+
别名: ``indices`` (类型为 list 或 tuple 时) 或 ``sections`` (类型为 int 时)
2325
- **axis** (int|Tensor,可选) - 整数或者形状为[]的 0-D Tensor,数据类型为 int32 或 int64。表示需要分割的维度。如果 ``axis < 0``,则划分的维度为 ``rank(x) + axis`` 。默认值为 0。
26+
别名: ``dim``
2427
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。
2528

2629
返回

0 commit comments

Comments
 (0)