@@ -4,8 +4,21 @@ function test_linalg(AT)
4
4
@test compare (adjoint, AT, rand (Float32, 32 , 32 ))
5
5
@test compare (transpose, AT, rand (Float32, 32 , 32 ))
6
6
@test compare (transpose!, AT, Array {Float32} (undef, 32 , 32 ), rand (Float32, 32 , 32 ))
7
+ @test compare (transpose!, AT, Array {Float32} (undef, 128 , 32 ), rand (Float32, 32 , 128 ))
8
+ end
9
+
10
+ @testset " copyto! for triangular" begin
11
+ ga = Array {Float32} (undef, 128 , 128 )
12
+ gb = AT {Float32} (undef, 128 , 128 )
13
+ rand! (gb)
14
+ copyto! (ga, UpperTriangular (gb))
15
+ @test ga == Array (collect (UpperTriangular (gb)))
16
+ ga = Array {Float32} (undef, 128 , 128 )
17
+ gb = AT {Float32} (undef, 128 , 128 )
18
+ rand! (gb)
19
+ copyto! (ga, LowerTriangular (gb))
20
+ @test ga == Array (collect (LowerTriangular (gb)))
7
21
end
8
-
9
22
@testset " permutedims" begin
10
23
@test compare (x -> permutedims (x, (2 , 1 )), AT, rand (Float32, 2 , 3 ))
11
24
@test compare (x -> permutedims (x, (2 , 1 , 3 )), AT, rand (Float32, 4 , 5 , 6 ))
@@ -26,13 +39,5 @@ function test_linalg(AT)
26
39
@test ishermitian (aherm)
27
40
end
28
41
end
29
- @testset " transpose fallback" begin
30
- m = 64
31
- n = 128
32
- a = randn (m,n)
33
- b = zeros (n,m)
34
- transpose! (b, a)
35
- @test b == transpose (a)
36
- end
37
42
end
38
43
end
0 commit comments