-
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 custom init grad for backward function #31540
Merged
MingMingShangTian
merged 23 commits into
PaddlePaddle:develop
from
MingMingShangTian:custom_staring_grad
Apr 1, 2021
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
d0915f8
add custom init grad for backward function
MingMingShangTian 0bccce6
add custom init grad for backward function
MingMingShangTian 5dac8e9
handle when the grad_tensor is none
MingMingShangTian ef4c7b9
handle when the grad_tensor is none
MingMingShangTian 33b0416
fix the args type error on windows platform
MingMingShangTian 837e26b
modify the args order and doc
MingMingShangTian 1901970
format code
MingMingShangTian 55e0cfb
add grad_tensor to xpu
MingMingShangTian 8271dc0
modify the grad_tensor type check
MingMingShangTian 5af3bd0
add paddle.backward api to support multi tensors gradient compute
MingMingShangTian 1467feb
add paddle.backward api to support multi tensors gradient compute
MingMingShangTian eb267fa
add paddle.atuograd module and backward api
MingMingShangTian b80f449
Merge branch 'develop' into custom_staring_grad
MingMingShangTian 2bb8f3c
change tensor.backward func args
MingMingShangTian 41b375f
modify tensor backward api
MingMingShangTian 6974e5c
remove create_graph intputs args
MingMingShangTian 1e3e975
add doc and examplex code for backward api
MingMingShangTian c7de011
when have the same tensor, throw error
MingMingShangTian 2f2824c
modify test Init func args
MingMingShangTian 8415df4
modify the execute.Init func args in test files
MingMingShangTian be065e4
add paddle.autograd package in setup.py.in
MingMingShangTian 7f8e58c
modify error msg, remove _run_backward method in class Tensor
MingMingShangTian 0374c0b
add test cases for backward api
MingMingShangTian 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 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 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 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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from ..fluid.dygraph.base import grad #DEFINE_ALIAS | ||
|
||
from . import backward_mode | ||
from .backward_mode import backward | ||
|
||
__all__ = ['grad'] | ||
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. also need 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. the next line |
||
|
||
__all__ += backward_mode.__all__ |
Oops, something went wrong.
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.
this method no need show to users, use
_
in the begining of method name, maybe still use_run_backward
is betterThere 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
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.
dygraph_run_backward
->_run_backward
, 不带下划线开头的是公开API,这个API不需要开放给用户