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
The reason will be displayed to describe this comment to others. Learn more.
@timholy I just found that these changes break the codes in Distributions.jl by removing methods like sum!(dst, a, region) and maximum!(dst, a, region) etc ...
The reason will be displayed to describe this comment to others. Learn more.
Shoot, sorry about that. But yes, once you've created dst you don't really need region anymore. Will you fix this by changing Distributions.jl, or do you want me to add versions that just drop the region argument?
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see you already noticed the need to fill!. I wondered if that was a bug or feature. An interesting thing about not having sum! do the fill itself is that now you can accumulate across multiple inputs a. I thought that was kinda cool, so I didn't have sum! call fill!.
maximum!, etc, all work similarly, of course.
And of course, none of this is exported anyway :-).
The reason will be displayed to describe this comment to others. Learn more.
While this behavior for sum! and maximum! seems useful, it is a bit surprising. How about a fill::Bool=true keyword option? I.e. default to filling the accumulator array with zeros before doing the reduction, but allow fill=false to not do that.
ea7987f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timholy I just found that these changes break the codes in Distributions.jl by removing methods like
sum!(dst, a, region)
andmaximum!(dst, a, region)
etc ...ea7987f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see ... it relies on the shape of
dst
to determine which dimension to reduce.ea7987f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoot, sorry about that. But yes, once you've created
dst
you don't really needregion
anymore. Will you fix this by changing Distributions.jl, or do you want me to add versions that just drop theregion
argument?ea7987f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already made changes accordingly in Distributions.jl. No worry about that.
ea7987f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In terms of the interface, I sometimes wanted to write things like:
Now, I will have to write
Not a big deal though.
ea7987f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see you already noticed the need to
fill!
. I wondered if that was a bug or feature. An interesting thing about not havingsum!
do the fill itself is that now you can accumulate across multiple inputsa
. I thought that was kinda cool, so I didn't havesum!
callfill!
.maximum!
, etc, all work similarly, of course.And of course, none of this is exported anyway :-).
ea7987f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this behavior for
sum!
andmaximum!
seems useful, it is a bit surprising. How about afill::Bool=true
keyword option? I.e. default to filling the accumulator array with zeros before doing the reduction, but allowfill=false
to not do that.