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

Fix handling of variable_eltype in stack #3043

Merged
merged 4 commits into from
May 2, 2022
Merged

Fix handling of variable_eltype in stack #3043

merged 4 commits into from
May 2, 2022

Conversation

bkamins
Copy link
Member

@bkamins bkamins commented Apr 28, 2022

Fixes #3042.

@nalimilan - I will make a patch release after this PR is merged

@bkamins bkamins requested a review from nalimilan April 28, 2022 08:53
@bkamins bkamins added the bug label Apr 28, 2022
@bkamins bkamins added this to the patch milestone Apr 28, 2022
test/reshape.jl Outdated Show resolved Hide resolved
test/reshape.jl Outdated Show resolved Hide resolved
Comment on lines 167 to 168
catnms = simnms isa Vector ? PooledArray(catnms) : simnms
copyto!(catnms, nms)
copyto!(simnms, nms)
catnms = simnms isa Vector ? PooledArray(simnms) : simnms
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why call copyto!(simnms, nms) rather than copyto!(catnms, nms) later? Wouldn't the latter be faster?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without JuliaData/PooledArrays.jl#82 released this will not work. After I make a release of PooledArrays.jl I will make this change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed this as indeed it is slightly faster. Here using copyto! should be safe as we know nms cannot have #undef so we are not affected by JuliaLang/julia#45125.

@bkamins bkamins merged commit a0d0b8b into main May 2, 2022
@bkamins bkamins deleted the bk/fix_stack branch May 2, 2022 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stack not catching invalid value of keyword variable_eltype
2 participants