Skip to content

Commit 8d8a633

Browse files
authored
Backport "Fix 0-dim broadcasting bug" to 0.9 (#177)
1 parent 31c97f4 commit 8d8a633

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "BlockSparseArrays"
22
uuid = "2c9a651f-6452-4ace-a6ac-809f4280fbb4"
33
authors = ["ITensor developers <[email protected]> and contributors"]
4-
version = "0.9.4"
4+
version = "0.9.5"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

src/blocksparsearrayinterface/broadcast.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ end
6363
# which is logic that is handled by `fill!`.
6464
function copyto_blocksparse!(dest::AbstractArray, bc::Broadcasted{<:AbstractArrayStyle{0}})
6565
# `[]` is used to unwrap zero-dimensional arrays.
66-
value = @allowscalar bc.f(bc.args...)[]
66+
bcf = Broadcast.flatten(bc)
67+
value = @allowscalar bcf.f(map(arg -> arg[], bcf.args)...)
6768
return @interface BlockSparseArrayInterface() fill!(dest, value)
6869
end
6970

0 commit comments

Comments
 (0)