Pass through nothing strides#1610
Closed
nhz2 wants to merge 3 commits into
Closed
Conversation
nhz2
commented
May 18, 2026
| function Base.strides(A::Adjoint{<:Real, <:AbstractVector}) | ||
| st = strides(A.parent) | ||
| isnothing(st) && return nothing | ||
| (st[1]*Int(length(A.parent)), st[1]) |
Member
Author
There was a problem hiding this comment.
st[1]*Int(length(A.parent)) should match stride(A.parent, 2) since the parent is an abstract vector: https://github.com/JuliaLang/julia/blob/201e056e9ee2398f01ecd2f104f9d8000b04d195/base/abstractarray.jl#L602
JuliaLang/julia#30432 has this return (1, st[1]). The first stride should not get used, so in theory its value shouldn't matter.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1610 +/- ##
==========================================
- Coverage 94.39% 94.37% -0.03%
==========================================
Files 35 35
Lines 16050 16062 +12
==========================================
+ Hits 15151 15159 +8
- Misses 899 903 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
|
Needs to wait on whether JuliaLang/julia#61807 is accepted. |
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.
Companion PR to JuliaLang/julia#61807
That PR changes
stridesto returnnothingon non-strided arrays instead of throwing an error.This PR changes
stridesofAdjointandTransposeto pass throughnothingifstrides(parent)isnothing.This PR should be merged before JuliaLang/julia#61807 is.