-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Enhance vjp/jvp/Jacobian/Hessian API for supporting dynamic, static graph and batched, unbatched mode #40692
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
14 commits
Select commit
Hold shift + click to select a range
fea9105
modify vjp/jvp for both dynamic and static graph
cxxly cc8f3c2
enforce jacobian class for supporting first/last batch
cxxly 2448db1
add unittest for jvp, jacobian withlast batch, jacobian with first batch
cxxly 3e0586e
fix the incorrect shape when multi-index Jacobian
cxxly 4e30e22
enforce Hessian class for supporting dynamic graph
cxxly 2105802
add Hessian class unittest
cxxly 5412477
bugfix, jvp double_backward_trick zeros_like return stop_gradient=Tru…
cxxly 570bdc6
add API beta warnnings
cxxly 84783db
add white_list for cuda11.x ci windows.
cxxly b1a7325
optimize some code snippets and documments
cxxly 1328aa2
set unittest timeout to 100 seconds
cxxly 9da1c01
move vjp,jvp,Jacobian,Hessian to incubate
cxxly 425d57b
fix vjp,vjp import path of sample code
cxxly 58c00e0
fix code style error of augtograd/__init__ file
cxxly 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
# 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 # noqa: F401 | ||
from ..fluid.dygraph.base import no_grad_ as no_grad # noqa: F401 | ||
from ..framework import is_grad_enabled, set_grad_enabled # noqa: F401 | ||
from . import backward_mode # noqa: F401 | ||
from .backward_mode import backward # noqa: F401 | ||
from .py_layer import PyLayer, PyLayerContext, EagerPyLayer, EagerPyLayerContext # noqa: F401 | ||
from ..framework import set_grad_enabled, is_grad_enabled # noqa: F401 | ||
from ..fluid.dygraph.base import no_grad_ as no_grad # noqa: F401 | ||
from .functional import jacobian, hessian, batch_jacobian, batch_hessian # noqa: F401 | ||
from .functional import vjp, jvp, vhp # noqa: F401 | ||
from .functional import vjp, jvp, Jacobian, Hessian # noqa: F401 | ||
from .functional import jacobian, hessian, batch_jacobian, batch_hessian, vhp # noqa: F401 | ||
levi131 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
__all__ = ['backward', 'PyLayer', 'PyLayerContext'] | ||
__all__ = [ # noqa | ||
'backward', | ||
'PyLayer', | ||
'PyLayerContext', | ||
] |
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.
Uh oh!
There was an error while loading. Please reload this page.