Skip to content

Commit 5621372

Browse files
fix: fix edge case of matrix shape when multiplying adjoint
1 parent 7df3904 commit 5621372

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/types.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2223,7 +2223,7 @@ function _check_adjoint_or_transpose(terms, result::ShapeT, first_arr::Union{Int
22232223
@nospecialize first_arr result
22242224
first_arr === nothing && return result
22252225
farr = terms[first_arr]
2226-
if result isa ShapeVecT && length(result) == 1 && length(result[1]) == 1 && (farr isa AdjointOrTranspose || iscall(farr) && (operation(farr) === adjoint || operation(farr) === transpose))
2226+
if result isa ShapeVecT && length(result) <= 2 && all(==(1) length, result) && (farr isa AdjointOrTranspose || iscall(farr) && (operation(farr) === adjoint || operation(farr) === transpose))
22272227
return ShapeVecT()
22282228
end
22292229
return result

0 commit comments

Comments
 (0)