|
59 | 59 | c1 = fill(NaN, 3, 4)
|
60 | 60 | @test mul!(c1, A, b1) == A * b1
|
61 | 61 | @test c1 == A * b1
|
62 |
| - |
| 62 | + |
63 | 63 | c4 = fill(NaN, 3, 6)
|
64 | 64 | @test mul!(c4, A, b4) == A * b4 # b4 is reshaped but still one-hot
|
65 | 65 | @test mul!(c4, A', b4) == A' * b4
|
66 | 66 | c6 = fill(NaN, 3, 4)
|
67 | 67 | @test mul!(c6, A, b6) == A * b6 # b4 is reshaped and not one-hot
|
68 | 68 | @test mul!(c6, A', b6) == A' * b6
|
69 |
| - |
| 69 | + |
70 | 70 | @test_throws DimensionMismatch mul!(c1, A, b2)
|
71 | 71 | @test_throws DimensionMismatch mul!(c1, A, b4)
|
72 | 72 | @test_throws DimensionMismatch mul!(c4, A, b1)
|
73 | 73 | @test_throws DimensionMismatch mul!(zeros(10, 3), A, b1)
|
| 74 | + |
| 75 | + # note that we have separate implementations for a couple of mul! for the time being |
| 76 | + |
| 77 | + d1 = fill(NaN, 3, 4) |
| 78 | + @test mul!(d1, A, b3') == A * Array(b3') |
| 79 | + @test mul!(d1, A, transpose(b3)) == A * Array(transpose(b3)) |
| 80 | + |
| 81 | + d2 = fill(NaN, 3, 6) |
| 82 | + @test mul!(d2, A, b5') == hcat(A[:,[1, 2, 3, 3]], A[:,1]+A[:,2], zeros(Int64, 3)) |
| 83 | + @test mul!(d2, A, transpose(b5)) == hcat(A[:,[1, 2, 3, 3]], A[:,1]+A[:,2], zeros(Int64, 3)) |
| 84 | + |
| 85 | + d3 = fill(NaN, 3, 6) |
| 86 | + @test mul!(d3, A, b7') == A[:,[1, 2, 3, 1, 2, 3]] |
| 87 | + @test mul!(d3, A, transpose(b7)) == A[:,[1, 2, 3, 1, 2, 3]] |
| 88 | + |
| 89 | + d4 = fill(NaN, 4, 4) |
| 90 | + @test_throws DimensionMismatch mul!(d4, A, b3') |
| 91 | + @test_throws DimensionMismatch mul!(d4, A, transpose(b3)) |
| 92 | + @test_throws DimensionMismatch mul!(d1, fill(1, (4,4)), b3') |
| 93 | + @test_throws DimensionMismatch mul!(d1, fill(1, (4,4)), transpose(b3)) |
74 | 94 | end
|
0 commit comments