Repository navigation
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.
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.
paddle 和 torch 的 api 在面对 dim == None / 缺省时的行为一致吗,如果一致可以删去。
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.
两者都不能为 None,paddle 在 api 层面设置了默认值,但其实默认值 None 会报错的,实现中实际需要的是整数,需要去改下,或者去适配 None 的时候 flatten(这个是 numpy 的行为),但是没看见别人反馈,应该是都没有使用默认值的情况,但是其他 cum 开头的函数确实会 flatten,感觉这个得去 Paddle 仓库提个 issue 问问。
我感觉提升比较好,但是有个流水线监控的很紧,很难通过,这个应该也要去 Paddle 问问😂
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.
我理解一下你的意思,并尝试回答一下:
A: 那这个就和删掉的 829 - 831 的意思是一致的。具体是 829,831
A: 与 830 一致了,原有代码就是对齐 paddle 输入 dim == None时,torch 需要将 x 展平。
A: 我们只需要关注这个 api 的情况就可以。
Uh oh!
There was an error while loading. Please reload this page.
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.
Thanks! 可能我描述的不太好,我想说的是 paddle 本身的问题,paddle 本身 dim 缺省默认的 None 是会报错的

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.
噢好的,那就只考虑 dim != None 的情况就可以,配置出现使 paddle api 报错的概率很低。