You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to get to the bottom of this and I think it is ultimately happening because collector can promote its arguments.
This seems like a reasonable behavior for collector, it is consistent with mutable types in Base, for example
◖◗ v = [1.0];
◖◗ push!(v, 1)
2-element Vector{Float64}:1.01.0
however it does NOT give the same behavior as collect.
This is a big problem because now to avoid promoting arguments, one has to resort to some unfortunate hacks. (The best method I've figured out is to wrap each element in Ref.).
I'm not entirely sure what is the best course of action to fix this. Again, it seems reasonable from the perspective of BangBang.jl but not so much from how it is used in Transducers.
There may be a way of rewriting this collect method in Transducers.jl, but at the moment it's not at all clear to me how that would be done without either making changes to BangBang or removing BangBang from some methods in Transducers.
The text was updated successfully, but these errors were encountered:
It's not clear to me why this isn't just how append!! is defined in this package already instead of the more promotion happy thing it's currently doing. Should we just see if we can replace append!! with conservative_append!!? Why would we want the current behaviour?
I've been trying to get to the bottom of this and I think it is ultimately happening because
collector
can promote its arguments.This seems like a reasonable behavior for
collector
, it is consistent with mutable types inBase
, for examplehowever it does NOT give the same behavior as
collect
.This is a big problem because now to avoid promoting arguments, one has to resort to some unfortunate hacks. (The best method I've figured out is to wrap each element in
Ref
.).This ultimately means that
I'm not entirely sure what is the best course of action to fix this. Again, it seems reasonable from the perspective of BangBang.jl but not so much from how it is used in Transducers.
There may be a way of rewriting this
collect
method in Transducers.jl, but at the moment it's not at all clear to me how that would be done without either making changes to BangBang or removing BangBang from some methods in Transducers.The text was updated successfully, but these errors were encountered: