-
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. 302 #236
转换规则 No. 302 #236
Conversation
Thanks for your contribution! |
paconvert/api_matcher.py
Outdated
@@ -4057,6 +4057,58 @@ def get_paddle_class_nodes(self, func, args, kwargs): | |||
).body | |||
|
|||
|
|||
class SparseCsrMatcher(BaseMatcher): |
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.
这个不可以直接复用GenericMatcher吗
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.
稀疏Tensor支持了cast API,cast 是通用的,你可以把GenericMatcher中的这段逻辑改成:
if dtype_v:
res += ".astype({})".format(dtype_v)
if dtype_v:
res += ".cast({})".format(dtype_v)
如果你想避免GenericMatcher处理某个参数,可以使用:
kwargs: ""
将其映射到空字符串
可以使用:
来配置,这样就不会使用默认的dtype处理方式 |
已修改 |
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
302 torch.sparse_csr_tensor 已有文档验证无误
PR APIs