From c95fc51a45057fff267078b6804e1a2c9136ce79 Mon Sep 17 00:00:00 2001 From: Willow Ahrens Date: Fri, 22 Mar 2024 13:18:38 -0400 Subject: [PATCH 1/3] fix --- src/interface/lazy.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/interface/lazy.jl b/src/interface/lazy.jl index 9d214016a..b4dbf6bff 100644 --- a/src/interface/lazy.jl +++ b/src/interface/lazy.jl @@ -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 From ae9e0f4868cb375c68a0bc3d8188cdf738286836 Mon Sep 17 00:00:00 2001 From: Willow Ahrens Date: Fri, 22 Mar 2024 13:19:38 -0400 Subject: [PATCH 2/3] add test --- test/test_interface.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test_interface.jl b/test/test_interface.jl index 6a2cc07f8..b3387b876 100644 --- a/test/test_interface.jl +++ b/test/test_interface.jl @@ -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 From f4e8dfb353f5bc77633f8822f65b3d8f3c73fe47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Sok=C3=B3=C5=82?= Date: Mon, 25 Mar 2024 11:02:37 +0100 Subject: [PATCH 3/3] Bump version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 53d482b69..72da15df3 100644 --- a/Project.toml +++ b/Project.toml @@ -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"