-
Notifications
You must be signed in to change notification settings - Fork 268
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 No.7】为 Paddle 新增 apply API rfcs #761
Conversation
此实现方案当前只能在CPU上运行,是否应该支持GPU运行,以及如何支持需要论证 |
按照API实现规范,要同时支持动态图和静态图,在静态图如何实现,也需要说明 |
@luotao1 @jeff41404 老师您好,我已经尝试添加了对于新旧 ir 静态图的支持,麻烦再review下吧。 |
) | ||
self._apply_(func) | ||
|
||
@framework.dygraph_only |
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.
done 删除该装饰器。
return self._apply(func) | ||
``` | ||
|
||
C++ 端则是在 eager_method.cc 中增加相应的逻辑,可以复用 PyTensorHook 来对 tensor 作用 callable python function。 |
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在CPU上,这样做是可以的;但如果Tensor在GPU上,这样实现是否能运行,需要说明
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.
done 新增加说明。
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
No description provided.