-
Notifications
You must be signed in to change notification settings - Fork 5.9k
add parameter of input in model.summary #34165
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 parameter of input in model.summary #34165
Conversation
|
Thanks for your contribution! |
python/paddle/hapi/model_summary.py
Outdated
| have multiple input, input_size must be a list which contain | ||
| every input's shape. Note that input_size only dim of | ||
| batch_size can be None or -1. | ||
| input (dict|list|): the input tensor. |
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.
input can be of any type. And need to explain, if given, input_size and dtype will be ignored.
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
python/paddle/hapi/model_summary.py
Outdated
| lenet = LeNet() | ||
| params_info = paddle.summary(lenet, (1, 1, 28, 28)) | ||
| input_data = [paddle.ones([1, 1, 28, 28])] |
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 not delete the original examples. Add new examples at the back, and add a example of dict and list 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
python/paddle/hapi/model_summary.py
Outdated
| elif isinstance(input, list): | ||
| _input = input | ||
| else: | ||
| raise Exception('Input must be list or dict.') |
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.
input can be any type as long as the network can run through
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
1819928
XiaoguangHu01
left a comment
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
Function optimization
PR changes
APIs
Describe
Add parameter of input in model.summary
If forward (self, x, y, z), it can use input_shape; if forward(self, x_list) or forward(self, x_dict), the input of dict or list can only be input.
Examples:
.. code-block:: python