-
Notifications
You must be signed in to change notification settings - Fork 6k
update samples of print and clip api, test=develop #27670
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b6e744a
update samples of print and clip api, test=document_fix
qili93 b63ab5b
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
qili93 ec10040
update sdg ref, test=document_fix
qili93 a00e7cb
update sdg ref link, test=document_fix
qili93 2083bd7
address review comments, test=document_fix
qili93 43dd36d
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
qili93 91da99f
address review comments, test=document_fix
qili93 a07bdab
address review comments, test=document_fix
qili93 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -259,24 +259,24 @@ def Print(input, | |
| Examples: | ||
| .. code-block:: python | ||
|
|
||
| import paddle.fluid as fluid | ||
|
|
||
| input = fluid.layers.fill_constant(shape=[10,2], value=3, dtype='int64') | ||
| input = fluid.layers.Print(input, message="The content of input layer:") | ||
|
|
||
| main_program = fluid.default_main_program() | ||
| exe = fluid.Executor(fluid.CPUPlace()) | ||
| exe.run(main_program) | ||
| import paddle | ||
|
|
||
| Output at runtime: | ||
| .. code-block:: bash | ||
|
|
||
| The content of input layer: The place is:CPUPlace | ||
| Tensor[fill_constant_0.tmp_0] | ||
| shape: [10,2,] | ||
| dtype: x | ||
| data: 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, | ||
|
|
||
| paddle.enable_static() | ||
|
|
||
| x = paddle.full(shape=[2, 3], fill_value=3, dtype='int64') | ||
| out = paddle.static.Print(x, message="The content of input layer:") | ||
|
|
||
| main_program = paddle.static.default_main_program() | ||
| exe = paddle.static.Executor(place=paddle.CPUPlace()) | ||
| res = exe.run(main_program, fetch_list=[out]) | ||
| # Variable: fill_constant_1.tmp_0 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Variable -> Tensor
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 确认过,静态图还是Variable,不用修改 |
||
| # - message: The content of input layer: | ||
| # - lod: {} | ||
| # - place: CPUPlace | ||
| # - shape: [2, 3] | ||
| # - layout: NCHW | ||
| # - dtype: long | ||
| # - data: [3 3 3 3 3 3] | ||
| ''' | ||
| check_variable_and_dtype(input, 'input', | ||
| ['float32', 'float64', 'int32', 'int64', 'bool'], | ||
|
|
||
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.
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.
225- 257 中 Variable-> 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.
确认过,静态图还是Variable,不用修改