Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Hackathon 5th No.17】 为 Paddle 新增 pdist API -part #57869

Merged
merged 26 commits into from
Dec 14, 2023
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3e19c90
add pdist api
cocoshe Oct 3, 2023
51b908a
move pdist to nn.functional, expose paddle.pdist api
cocoshe Oct 7, 2023
ced239c
clean
cocoshe Oct 7, 2023
9c651d9
clean
cocoshe Oct 7, 2023
13d04ad
fix codestyle
cocoshe Oct 21, 2023
8bcbe47
fix conflict
cocoshe Nov 11, 2023
212bdf7
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
cocoshe Nov 24, 2023
7bbc22e
remove compute_mode
cocoshe Nov 24, 2023
20f82de
for api name rules
cocoshe Nov 24, 2023
b06dd06
Merge branch 'develop' into pdist_coco_dev
cocoshe Nov 29, 2023
2e259a6
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
cocoshe Nov 30, 2023
e9dfa5a
Update test_pdist.py
cocoshe Nov 30, 2023
cddec3b
Merge branch 'pdist_coco_dev' of https://github.com/cocoshe/Paddle in…
cocoshe Nov 30, 2023
23d5f7e
add seed
cocoshe Nov 30, 2023
3a9fbfb
fix code sample
cocoshe Dec 1, 2023
e41f9dc
Merge branch 'pdist_coco_dev' of https://github.com/cocoshe/Paddle in…
cocoshe Dec 5, 2023
008ae5b
fix doc
cocoshe Dec 5, 2023
114453a
Update distance.py
cocoshe Dec 5, 2023
171339d
gpu0 to cpu in api doc
cocoshe Dec 9, 2023
8a281b4
gpu0 to cpu in api doc
cocoshe Dec 9, 2023
a9d053c
remove pdist in nn.functional __all__ list
cocoshe Dec 12, 2023
b3816df
Merge branch 'develop' into pdist_coco_dev
cocoshe Dec 12, 2023
3f7b607
Update __init__.py
cocoshe Dec 12, 2023
e3e5abf
fix en doc
cocoshe Dec 13, 2023
8172f28
Update python/paddle/nn/functional/distance.py
cocoshe Dec 13, 2023
0146a37
Update python/paddle/nn/functional/distance.py
cocoshe Dec 13, 2023
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
Prev Previous commit
Next Next commit
Update distance.py
cocoshe authored Dec 5, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 114453a6b7afc071ebf6c08a58d626e3a2d1856e
6 changes: 0 additions & 6 deletions python/paddle/nn/functional/distance.py
Original file line number Diff line number Diff line change
@@ -126,12 +126,6 @@ def pdist(x, p=2.0, name=None):
>>> import paddle
>>> paddle.seed(2023)
>>> a = paddle.randn([4, 5])
Copy link
Contributor

@zxcd zxcd Nov 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc中给出seed,不然PR-CI-Static-Check过不了
参考:

>>> paddle.seed(2023)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc中给出seed,不然PR-CI-Static-Check过不了 参考:

>>> paddle.seed(2023)

现在添加了,但是好像没作用嘛?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

添加了seed之后,你的print的结果也会有变化,这块的输出你可以参考报错的内容

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

添加了seed之后,你的print的结果也会有变化,这块的输出你可以参考报错的内容

明白了,稍后修改~

>>> print(a)
Tensor(shape=[4, 5], dtype=float32, place=Place(gpu:0), stop_gradient=True,
[[-0.49133155, 0.53819323, -3.10416031, -1.51671720, -0.29990962],
[ 0.22085167, -0.00404538, 0.40126652, 0.53417486, 0.84864247],
[ 0.78248203, -1.59652555, -0.14399840, 1.29321253, 0.06063633],
[-0.30991879, -0.99713278, -0.51025450, -0.42649266, 0.61627960]])
>>> pdist_out=paddle.pdist(a)
>>> print(pdist_out)
Tensor(shape=[6], dtype=float32, place=Place(gpu:0), stop_gradient=True,