[Type] Tensor 5: Document and test needs_grad on the factories#525
Draft
hughperkins wants to merge 5 commits intohp/tensor-stork-4from
Draft
[Type] Tensor 5: Document and test needs_grad on the factories#525hughperkins wants to merge 5 commits intohp/tensor-stork-4from
hughperkins wants to merge 5 commits intohp/tensor-stork-4from
Conversation
needs_grad already passes through the factory **kwargs (PRs 2-3); this PR makes that contract explicit with tests and a user-guide section. Adds: - 6 tests covering grad allocation, primal+grad kernel round-trip on field and ndarray scalar backends, and grad on tensor_vec/tensor_mat field. - "Gradients" section in the user guide showing the needs_grad= usage on both backends with a runnable example. Documented limitation: qd.Vector.ndarray and qd.Matrix.ndarray do not currently accept needs_grad — that's an upstream Quadrants limitation and is noted in a code comment inside the test file. All tests pass; sphinx build clean.
adf0542 to
923d97e
Compare
2743267 to
e1540b7
Compare
923d97e to
a79a2d7
Compare
Drops the 'flexible' prefix from filenames and identifiers introduced in this branch series so the user-visible names are simply 'tensor'. Also strips PR-N back-references that will be meaningless once these PRs land. Touches only files owned by this series (no changes to external/ or unrelated tests).
- Apply black/ruff auto-fixes to _tensor.py and import ordering - Add pylint disable=import-outside-toplevel for late imports - Fix broken anchors #fields/#ndarrays in tensor.md (point to tensor_types.md) - Add Backend, tensor*, tensor_annotation to test_api.py expected names Made-with: Cursor
…r-stork-5 Made-with: Cursor # Conflicts: # docs/source/user_guide/tensor.md # python/quadrants/_tensor.py
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.
needs_grad already passes through the factory **kwargs (PRs 2-3); this PR makes that contract explicit with tests and a user-guide section.
Adds:
Documented limitation: qd.Vector.ndarray and qd.Matrix.ndarray do not currently accept needs_grad — that's an upstream Quadrants limitation and is noted in a code comment inside the test file.
All tests pass; sphinx build clean.
Issue: #
Brief Summary
copilot:summary
Walkthrough
copilot:walkthrough