fix(autojac): Replace unsafe use of view with reshape#582
Merged
ValerianRey merged 2 commits intoSimplexLab:mainfrom Feb 19, 2026
Merged
fix(autojac): Replace unsafe use of view with reshape#582ValerianRey merged 2 commits intoSimplexLab:mainfrom
view with reshape#582ValerianRey merged 2 commits intoSimplexLab:mainfrom
Conversation
… coverage for noncontiguous jacobians.
Contributor
|
Thanks a lot for the PR! I don't think it is possible to have a non continuous gradient here, but I can't be sure so this is very good! The test is nice, but I'll let @ValerianRey review it, I think it would be nice to run it while changing |
Contributor
Author
|
I did test it removing the reshape to view in unite Jacobian, and it
failed. So the previous reshape change there was necessary.
…On Thu, Feb 19, 2026 at 16:53 Pierre Quinton ***@***.***> wrote:
*PierreQuinton* left a comment (SimplexLab/TorchJD#582)
<#582 (comment)>
I don't think it is possible to have a non continuous gradient here, but I
can't be sure so this is very good! The test is nice, but I'll let
@ValerianRey <https://github.com/ValerianRey> review it, I think it would
be nice to run it while changing reshape to view in _unite_jacobians to
see if this fails.
—
Reply to this email directly, view it on GitHub
<#582 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACBG26EL3UAPLUOZ6KASB434MVTV3AVCNFSM6AAAAACVUXEC7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTSMRVGI2TOMBZHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
view with reshape
PierreQuinton
approved these changes
Feb 19, 2026
Contributor
PierreQuinton
left a comment
There was a problem hiding this comment.
Fantastic, LGTM then. Congratulation on the first PR (maybe we still wait on @ValerianRey just in case he had something in mind)
ValerianRey
approved these changes
Feb 19, 2026
Contributor
ValerianRey
left a comment
There was a problem hiding this comment.
LGTM! Thanks for the contribution!
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.
I could not find a way to produce non-contiguous tensors as the output of the gradient_vector.split(...) call, but I've added the safer .reshape nonetheless. I also added a test to make sure that non-contiguous jacobians are safely handled.