Skip to content
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

paddle.nn.LayerList存在问题,长度为0时无法insert #71224

Open
zhwesky2010 opened this issue Feb 21, 2025 · 0 comments
Open

paddle.nn.LayerList存在问题,长度为0时无法insert #71224

zhwesky2010 opened this issue Feb 21, 2025 · 0 comments
Assignees

Comments

@zhwesky2010
Copy link
Contributor

zhwesky2010 commented Feb 21, 2025

bug描述 Describe the Bug

写模型时LayerList.insert(0, llinear)报错,而竞品的ModuleList.insert(0, linear)可以运行。

torch代码可以正常运行:

import torch
modules = torch.nn.ModuleList()
modules.insert(0, torch.nn.Linear(10, 10))

而Paddle运行会报错:

import paddle
layers = paddle.nn.LayerList()
layers.insert(0, paddle.nn.Linear(10, 10))

排查是LayerList的功能问题,需要支持长度为0时的insert

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

No branches or pull requests

3 participants