-
Notifications
You must be signed in to change notification settings - Fork 53
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
转换规则 No. 219/230 #273
Conversation
Thanks for your contribution! |
import torch | ||
indices = [[0, 1, 2], [1, 2, 0]] | ||
values = [1., 2., 3.] | ||
x = torch.sparse_coo_tensor(indices, values, [3, 3]) |
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.
torch的支持sparse_csr_tensor吗?稀疏分两种格式:COO与CSR,可以再测几个CSR的格式
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.
code = "" | ||
if "dtype" in kwargs: | ||
dtype_v = kwargs.pop("dtype") | ||
code = code + "{}=paddle.sparse.cast({}, value_dtype={})\n".format( |
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.
建议换一种写法,用一个临时值来表达,sparse.cast的输出。因为输入可能是一个运算表达式,例如torch.sparse.softmax(x*2)
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.
LGTM
PR Docs
#112
219 torch.profiler.schedule 已有文档验证无误
230 torch.sparse.softmax 已有文档验证无误
PR APIs