add parameter of input in model.summary#34165
Merged
LielinJiang merged 17 commits intoPaddlePaddle:developfrom Jul 29, 2021
Merged
add parameter of input in model.summary#34165LielinJiang merged 17 commits intoPaddlePaddle:developfrom
LielinJiang merged 17 commits intoPaddlePaddle:developfrom
Conversation
|
Thanks for your contribution! |
dingjiaweiww
previously approved these changes
Jul 15, 2021
LielinJiang
reviewed
Jul 15, 2021
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. |
Contributor
There was a problem hiding this comment.
input can be of any type. And need to explain, if given, input_size and dtype will be ignored.
LielinJiang
reviewed
Jul 15, 2021
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])] |
Contributor
There was a problem hiding this comment.
do not delete the original examples. Add new examples at the back, and add a example of dict and list input.
LielinJiang
reviewed
Jul 15, 2021
python/paddle/hapi/model_summary.py
Outdated
| elif isinstance(input, list): | ||
| _input = input | ||
| else: | ||
| raise Exception('Input must be list or dict.') |
Contributor
There was a problem hiding this comment.
input can be any type as long as the network can run through
LielinJiang
previously approved these changes
Jul 20, 2021
dingjiaweiww
previously approved these changes
Jul 20, 2021
1819928
LielinJiang
previously approved these changes
Jul 27, 2021
dingjiaweiww
previously approved these changes
Jul 27, 2021
LielinJiang
approved these changes
Jul 28, 2021
dingjiaweiww
approved these changes
Jul 29, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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