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

转换规则 No. 219/230 #273

Merged
merged 2 commits into from
Sep 7, 2023
Merged

转换规则 No. 219/230 #273

merged 2 commits into from
Sep 7, 2023

Conversation

co63oc
Copy link
Contributor

@co63oc co63oc commented Sep 6, 2023

PR Docs

#112
219 torch.profiler.schedule 已有文档验证无误
230 torch.sparse.softmax 已有文档验证无误

PR APIs

@paddle-bot
Copy link

paddle-bot bot commented Sep 6, 2023

Thanks for your contribution!

@paddle-bot paddle-bot bot added the contributor External developers label Sep 6, 2023
@co63oc co63oc added the HappyOpenSource 快乐开源活动issue与PR label Sep 6, 2023
import torch
indices = [[0, 1, 2], [1, 2, 0]]
values = [1., 2., 3.]
x = torch.sparse_coo_tensor(indices, values, [3, 3])
Copy link
Collaborator

Choose a reason for hiding this comment

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

torch的支持sparse_csr_tensor吗?稀疏分两种格式:COO与CSR,可以再测几个CSR的格式

Copy link
Contributor Author

Choose a reason for hiding this comment

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

图片
torch不支持CSR格式

code = ""
if "dtype" in kwargs:
dtype_v = kwargs.pop("dtype")
code = code + "{}=paddle.sparse.cast({}, value_dtype={})\n".format(
Copy link
Collaborator

Choose a reason for hiding this comment

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

建议换一种写法,用一个临时值来表达,sparse.cast的输出。因为输入可能是一个运算表达式,例如torch.sparse.softmax(x*2)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

Copy link
Collaborator

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

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

LGTM

@zhwesky2010 zhwesky2010 merged commit 4377923 into PaddlePaddle:master Sep 7, 2023
@co63oc co63oc deleted the api230 branch September 7, 2023 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants