Skip to content

Commit

Permalink
【Hackathon 5th No.17】 为 Paddle 新增 pdist API 中文文档 (#6391)
Browse files Browse the repository at this point in the history
* add householder_product_cn doc

* doc style

* add pdist cn doc

* Update Overview_cn.rst

* Update Overview_cn.rst

* Delete docs/api/paddle/linalg/householder_product_cn.rst
  • Loading branch information
cocoshe authored Dec 18, 2023
1 parent 26f1888 commit bc66ad7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/api/paddle/Overview_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ tensor 线性代数相关
" :ref:`paddle.triu <cn_api_paddle_triu>` ", "返回输入矩阵 input 的上三角部分,其余部分被设为 0"
" :ref:`paddle.triu_indices <cn_api_paddle_triu_indices>` ", "返回输入矩阵在给定对角线右上三角部分元素坐标"
" :ref:`paddle.cdist <cn_api_paddle_cdist>` ", "计算两组输入集合 x, y 中每对之间的 p 范数"
" :ref:`paddle.pdist <cn_api_paddle_pdist>` ", "计算输入形状为 N x M 的 Tensor 中 N 个向量两两组合(pairwise)的 p 范数"

.. _tensor_manipulation:

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

pdist
-------------------------------

.. py:function:: paddle.pdist(x, p=2.0, name=None):
计算输入形状为 N x M 的 Tensor 中 N 个向量两两组合(pairwise)的 p 范数。


参数
::::::::::::

- **x** (Tensor) - 输入的 Tensor,形状为 :math:`N \times M` 。
- **p** (float, 可选) - 计算每个向量对之间的 p 范数距离的值。默认值为 :math:`2.0`。
- **name** (str, 可选) - 具体用法请参见 :ref:`api_guide_Name` ,一般无需设置,默认值为 None。

返回
::::::::::::
Tensor,数据类型与输入张量相同,输出的形状为 :math:`N \times (N-1) \div 2`。

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

COPY-FROM: paddle.pdist

0 comments on commit bc66ad7

Please sign in to comment.