Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 4th No.30】为 Paddle 新增 paddle.sparse.sum 稀疏 API #51406
【Hackathon 4th No.30】为 Paddle 新增 paddle.sparse.sum 稀疏 API #51406
Changes from 55 commits
3ba8bce
2b4ea91
fe92011
12e8f33
dc1c028
6e2ceda
60b8780
6b818e7
8ab243f
ad9166c
ef0e89a
0fb2707
f5c7765
fd2fed0
b2137b1
1786e84
260706b
c2844de
f1a441e
40fb8c2
6bb3977
6cc42be
d273ad2
8525c6a
2007c83
bbf4923
198856c
6abccfa
98a3d4d
13e16a3
9cecc0f
a66e3a4
3d61c7a
94edf06
645d82b
4426cf6
907d0e9
80a6be0
6134ba5
1378c9f
aa84e2c
ee92a93
90c0314
544aa85
80fd0de
1a63118
28a5173
e6428fe
1b2c6b1
4157bd5
f487a74
b6c482e
09411ee
27a1cca
76942bc
0ebfb9f
b3ce86a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请教下,这里为什么要加一个判断呢?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是因为如果指定了输出 dtype,dxvalues会保持和输出dout的类型一样,但是和dx不同,调用sparse_to_dense就会报错
ValueError: (InvalidArgument) The type of data we are trying to retrieve (float64) does not match the type of data (float32) currently contained in the container.
[Hint: Expected dtype() == phi::CppTypeToDataType::Type(), but received dtype():10 != phi::CppTypeToDataType::Type():11.] (at /Paddle/paddle/phi/core/dense_tensor.cc:163)
这里通过这个把dxvalues转换成和dx相同的类型