From 62c8f4d96f7740356d8f6f3bbff2fd783e8dc687 Mon Sep 17 00:00:00 2001 From: odow Date: Mon, 25 Mar 2024 11:37:16 +1300 Subject: [PATCH] Update --- src/interface.jl | 8 +++----- test/matmul.jl | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/interface.jl b/src/interface.jl index eaddbfa..c515949 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -288,13 +288,11 @@ function mutability( op::typeof(*), args::Vararg{Any,N}, ) where {N} - if mutability(typeof(x), op, typeof.(args)...) == IsNotMutable() - return IsNotMutable() - elseif size(x) == _size_after_multiply(size.(args)...) + is_mutable = mutability(typeof(x), op, typeof.(args)...) + if is_mutable && size(x) == _size_after_multiply(size.(args)...) return IsMutable() - else - return IsNotMutable() end + return IsNotMutable() end function _size_after_multiply(x::NTuple{M,Int}, y::NTuple{N,Int}) where {N,M} diff --git a/test/matmul.jl b/test/matmul.jl index 4993264..029edcc 100644 --- a/test/matmul.jl +++ b/test/matmul.jl @@ -424,14 +424,14 @@ Base.:*(m::Monomial, ::Monomial) = m end @testset "Issue_271" begin - A = [1; 2;;] + A = reshape([1, 2], (2, 1)) B = [1 2] C = MA.operate!!(*, A, B) - @test A == [1; 2;;] + @test A == reshape([1, 2], (2, 1)) @test B == [1 2] @test C == A * B D = MA.operate!!(*, B, A) - @test A == [1; 2;;] + @test A == reshape([1, 2], (2, 1)) @test B == [1 2] @test D == B * A end