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

handle stack with abstract eltype #56776

Closed
wants to merge 1 commit into from

Conversation

adienes
Copy link
Contributor

@adienes adienes commented Dec 7, 2024

fixes #56771

probably not perfectly universally robust, but I bet this catches 95%+ of encountered instances.

@mcabbott
Copy link
Contributor

mcabbott commented Dec 7, 2024

I think the two problems with this approach are (1) it calls first, while everything else in stack is careful to never run the iterator more than once, and (2) it fails for other abstract types:

julia> it = Iterators.product(1:2, 3:5);

julia> stack(Iterators.ProductIterator[it for _ in 1:4]; dims=2) |> size
(2, 3, 4)

@adienes adienes closed this Dec 7, 2024
@adienes adienes deleted the abstract_stack branch December 7, 2024 22:12
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

Successfully merging this pull request may close these issues.

bug in stack for collection of abstract arrays
2 participants