-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add LayerDict class #31951
Add LayerDict class #31951
Conversation
Thanks for your contribution! |
python/paddle/nn/layer/container.py
Outdated
#relu : ReLU() | ||
|
||
""" | ||
for key, layer in sublayers.items(): |
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.
Do we need add checking for inputs?
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.
add the inputs checking
python/paddle/nn/layer/container.py
Outdated
def __init__(self, sublayers=None): | ||
super(LayerDict, self).__init__() | ||
if sublayers is not None: | ||
self._sub_layers.update(sublayers) |
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.
here need call self.update
, and the input should be checked in update
method, otherwise here also need to check input
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
26a7c2a
to
be5af53
Compare
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
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
PR types
New features
PR changes
APIs
Describe
Add LayerDict to store the layers with its name.