Skip to content
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

Broadcast Strided calls fail with Base.ReshpaedArray #26

Closed
kmp5VT opened this issue Dec 15, 2023 · 1 comment
Closed

Broadcast Strided calls fail with Base.ReshpaedArray #26

kmp5VT opened this issue Dec 15, 2023 · 1 comment

Comments

@kmp5VT
Copy link

kmp5VT commented Dec 15, 2023

Hi I am trying to use strided on a Base.ReshapedArray and am returned a StackOverflow here are some examples

y = reshape(randn(elt, 8)', 2, 4)
x = Base.ReshapedArray(randn(elt, 8, 8)'[1:8], (2, 4), ())
y .= y .* x
# works 
@strided x .= x .* x

# stack overflow
@strided y .= y .* x
@strided x .= x .* y
@strided y .= y .* y

I was able to get some stacktrace regarding where the stack overflow is happening see the following

[1] sreshape(a::LinearAlgebra.Adjoint{Float32, StridedViews.StridedView{Float32, 1, Vector{Float32}, typeof(identity)}}, newsize::Tuple{Int64, Int64}) (repeats 42823 times)
      @ StridedViews ~/.julia/packages/StridedViews/bIjcq/src/stridedview.jl:172
    [2] StridedViews.StridedView(a::Base.ReshapedArray{Float32, 2, LinearAlgebra.Adjoint{Float32, Vector{Float32}}, Tuple{}})
      @ StridedViews ~/.julia/packages/StridedViews/bIjcq/src/stridedview.jl:50
    [3] maybestrided(A::Base.ReshapedArray{Float32, 2, LinearAlgebra.Adjoint{Float32, Vector{Float32}}, Tuple{}})
      @ Strided ~/.julia/packages/Strided/l1vm3/src/macros.jl:32
@kmp5VT
Copy link
Author

kmp5VT commented Dec 15, 2023

This issue appears to be solved with Jutho/StridedViews.jl#5

@kmp5VT kmp5VT closed this as completed Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant