Skip to content

Conversation

ADream-ki
Copy link
Contributor

@ADream-ki ADream-ki commented Apr 22, 2024

PR Category

Others

PR Types

Others

Description

为paddle补齐zeropad1d和zeropad3d api,同时添加block_diag api以丰富paddle功能

Copy link

paddle-bot bot commented Apr 22, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Apr 22, 2024
@luotao1 luotao1 added the API label Apr 24, 2024
@ADream-ki
Copy link
Contributor Author

已经好了 @luotao1 @Charles-hit

Copy link

paddle-ci-bot bot commented May 8, 2024

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.

Copy link
Contributor

@Charles-hit Charles-hit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pad 可以cpu gpu都测试一下

@ADream-ki
Copy link
Contributor Author

Pad 可以cpu gpu都测试一下

已经好了

Charles-hit
Charles-hit previously approved these changes May 13, 2024
Copy link
Contributor

@Charles-hit Charles-hit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR描述加一下吧

@ADream-ki
Copy link
Contributor Author

PR描述加一下吧

已经好了,请review

from .layers import Layer


class ZeroPad1D(Layer):
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

抱歉 这边的话还是放一起合适点。 @Chen-Lun-Hao

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,那我移到common那里去

Copy link

paddle-ci-bot bot commented May 17, 2024

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.

@ADream-ki
Copy link
Contributor Author

I have already run CI again @jeff41404

@ADream-ki
Copy link
Contributor Author

已经修改,同时已更新rfc @Charles-hit @jeff41404

@ADream-ki
Copy link
Contributor Author

pr已经全部实现,能不能先不关闭? @luotao1

@@ -6861,3 +6861,67 @@ def slice_scatter(x, value, axes, starts, ends, strides, name=None):
)

return output


def block_diag(*inputs, name=None):
Copy link
Contributor

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

@ADream-ki
Copy link
Contributor Author

PaddlePaddle/community#906 對應的rfc也修改了

@ADream-ki
Copy link
Contributor Author

I have made the changes, please review @jeff41404

Copy link
Contributor

@jeff41404 jeff41404 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

paddle-ci-bot bot commented May 31, 2024

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.

Copy link
Contributor

@sunzhongkai588 sunzhongkai588 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for docs

@luotao1 luotao1 changed the title 【Hackathon 6th No.3】为 Paddle 新增 ZeroPad1D / ZeroPad3D / block_diag API 【Hackathon 6th No.3】为 Paddle 新增 ZeroPad1D / ZeroPad3D / block_diag API -part Jun 3, 2024
@luotao1 luotao1 merged commit 7a8eda5 into PaddlePaddle:develop Jun 3, 2024
Copy link
Contributor

@luotao1 luotao1 left a 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( 可以废弃。辛苦在

def zeropad2d(
x: Tensor,
padding: ShapeLike,
data_format: DataLayout2D = "NCHW",
name: str | None = None,

前面加一个 @deprecated(,类似
@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

@ADream-ki
Copy link
Contributor Author

@jeff41404 @zhwesky2010 讨论: def zeropad2d( 可以废弃。辛苦在

def zeropad2d(
x: Tensor,
padding: ShapeLike,
data_format: DataLayout2D = "NCHW",
name: str | None = None,

前面加一个 @deprecated(,类似

@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

好的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants