Skip to content

Commit a92241b

Browse files
committed
Better overloading of similar of block sparse broadcasting expressions
1 parent 6211e57 commit a92241b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
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.2.20"
4+
version = "0.2.21"
55

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

src/blocksparsearrayinterface/broadcast.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ function Broadcast.BroadcastStyle(
3131
return DefaultArrayStyle{N}()
3232
end
3333

34-
function Base.similar(bc::Broadcasted{<:BlockSparseArrayStyle}, elt::Type)
35-
# TODO: Make sure this handles GPU arrays properly.
34+
function Base.similar(bc::Broadcasted{<:BlockSparseArrayStyle}, elt::Type, ax)
35+
# TODO: Make this more generic, base it off sure this handles GPU arrays properly.
3636
m = Mapped(bc)
37-
return similar(first(m.args), elt, combine_axes(axes.(m.args)...))
37+
return similar(first(m.args), elt, ax)
3838
end
3939

4040
# Catches cases like `dest .= value` or `dest .= value1 .+ value2`.

0 commit comments

Comments
 (0)