Skip to content

Commit

Permalink
Merge pull request #482 from willow-ahrens/wma/fix481
Browse files Browse the repository at this point in the history
Wma/fix481
  • Loading branch information
mtsokol authored Mar 25, 2024
2 parents ba60c84 + f4e8dfb commit 14e0f0f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Finch"
uuid = "9177782c-1635-4eb9-9bfb-d9dfa25e6bce"
authors = ["Willow Ahrens"]
version = "0.6.19"
version = "0.6.20"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down
3 changes: 2 additions & 1 deletion src/interface/lazy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ Base.copyto!(out, bc::Broadcasted{LazyStyle{N}}) where {N} = copyto!(out, copy(b

function Base.copy(bc::Broadcasted{LazyStyle{N}}) where {N}
bc_lgc = broadcast_to_logic(bc)
data = broadcast_to_query(bc_lgc, [field(gensym(:i)) for _ in 1:N])
idxs = [field(gensym(:i)) for _ in 1:N]
data = reorder(broadcast_to_query(bc_lgc, idxs), idxs)
extrude = ntuple(n -> broadcast_to_extrude(bc_lgc, n), N)
return LazyTensor{eltype(bc)}(identify(data), extrude)
end
Expand Down
7 changes: 7 additions & 0 deletions test/test_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,11 @@ using Finch: AsArray
@test Array(A_result) == A_t
@test permutedims(A_tns, perm) == A_t
end

#https://github.com/willow-ahrens/Finch.jl/issues/481
let
r = fsprand(1, 10, 10, 0.01)
r_tns = Tensor(Dense(Dense(Dense(Element(0.0)))), r)
@test r_tns + r_tns == 2 * r_tns
end
end

2 comments on commit 14e0f0f

@mtsokol
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/103547

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.6.20 -m "<description of version>" 14e0f0f5e4bddb887a1b902fff8504b57af8d4ed
git push origin v0.6.20

Please sign in to comment.