Closed mtfishman closed 10 months ago
I am a bit hesitant about this. This means that transpose(v) * v
no longer yields a number, which was the whole point why the Transpose
objects were created in Julia Base. While the transpose
behaviour is not officially specified in the AbstractArray
interface, I do feel like this constitutes a violation of the AbstractArray
interface that I would prefer to avoid.
Oh good point, I hadn't considered that usage of transpose
/adjoint
.
I think adding these lines below line 172 would also resolve your issue:
function sreshape(a::LinearAlgebra.AdjointAbsVec, newsize::Dims)
return sreshape(conj(StridedView(adjoint(a))), newsize)
end
function sreshape(a::LinearAlgebra.TransposeAbsVec, newsize::Dims)
return sreshape(StridedView(transpose(a)), newsize)
end
From CI, it seems like I will also have to check what is going on with Aqua.jl ?
That looks like a good fix, thanks. I can update this PR with that fix and look into the Aqua issue.
That would be great, it's getting a bit late here to focus and do stuff properly. Feel free to bump the patch version while you are at it, then I can merge tomorrow morning if all lights turn green and immediately register the new version.
Ok, I changed it over to your fix, updated the tests, and updated to the latest Aqua syntax (I just removed the project_toml_formatting
keyword argument since it was removed in https://github.com/JuliaTesting/Aqua.jl/pull/209).
Looks like the CI needs your approval to run.
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
00be762
) 93.52% compared to head (feefe73
) 93.67%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hi @Jutho, this makes it so that
transpose
andadjoint
of vectorStridedView
remains aStridedView
.I did this by generalizing
transpose
andadjoint
to support both matrix and vectorStridedView
by callingpermutedims(::StridedView)
, and then making sure that works for vectorStridedView
by callingsreshape
(so this PR also fixespermutedims(::StridedView)
for vectorStridedView
as well). Open to other approaches.