Skip to content

遍历 paddle.nn.Sequential()时候有bug #39220

Closed
@anliyuan

Description

@anliyuan

import paddle
layers = paddle.nn.Sequential()
for i in range(10):
layers.add_sublayer('block'+str(i), paddle.nn.Linear(10, 10))
for layer in layers:
print(layer)

这里会报一个KeyError,但是如果add_sublayer时候不写'block'就不会报错。bug

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions