CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
【Hackathon 6th No.3】为 Paddle 新增 ZeroPad1D / ZeroPad3D / block_diag API -part #63728
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
已经好了 @luotao1 @Charles-hit |
Sorry to inform you that 2cb256d's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
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.
Pad 可以cpu 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.
PR描述加一下吧
已经好了,请review |
python/paddle/nn/layer/padding.py
Outdated
from .layers import Layer | ||
|
||
|
||
class ZeroPad1D(Layer): |
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.
why not add ZeroPad1D
and ZeroPad3D
in python/paddle/nn/layer/common.py, together with ZeroPad2D
for easy maintenance in the future?
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.
Because according to the requirements in the task, I need to implement it in the corresponding file instead of ‘common.py’ @jeff41404
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.
抱歉 这边的话还是放一起合适点。 @Chen-Lun-Hao
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.
好的,那我移到common那里去
Sorry to inform you that b382c5e's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
I have already run CI again @jeff41404 |
已经修改,同时已更新rfc @Charles-hit @jeff41404 |
pr已经全部实现,能不能先不关闭? @luotao1 |
python/paddle/tensor/manipulation.py
Outdated
@@ -6861,3 +6861,67 @@ def slice_scatter(x, value, axes, starts, ends, strides, name=None): | |||
) | |||
|
|||
return output | |||
|
|||
|
|||
def block_diag(*inputs, name=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.
According to the current specification of PaddlePaddle, when the input may be multiple tensors, the parameters cannot be passed in this way. You need to put multiple tensors into a list or tuple before passing in. Please refer to the broadcast_tensors API
PaddlePaddle/community#906 對應的rfc也修改了 |
I have made the changes, please review @jeff41404 |
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
Sorry to inform you that d05dd19's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
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 for docs
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.
和 @jeff41404 @zhwesky2010 讨论:
def zeropad2d(
可以废弃。辛苦在
Paddle/python/paddle/nn/functional/common.py
Lines 1883 to 1887 in fc1d21a
def zeropad2d( | |
x: Tensor, | |
padding: ShapeLike, | |
data_format: DataLayout2D = "NCHW", | |
name: str | None = None, |
前面加一个
@deprecated(
,类似Paddle/python/paddle/dataset/imdb.py
Lines 78 to 83 in fc1d21a
@deprecated( | |
since="2.0.0", | |
update_to="paddle.text.datasets.Imdb", | |
level=1, | |
reason="Please use new dataset API which supports paddle.io.DataLoader", | |
) |
since="3.0.0",
update_to="paddle.nn.ZeroPad2D",
@Chen-Lun-Hao
好的 |
PR Category
Others
PR Types
Others
Description
为paddle补齐zeropad1d和zeropad3d api,同时添加block_diag api以丰富paddle功能