@@ -3,7 +3,7 @@ using Reactant
33using OMEinsum
44
55@testset " sum" begin
6- a = Reactant. TestUtils. construct_test_array (ComplexF64 , 2 , 3 )
6+ a = Reactant. TestUtils. construct_test_array (ComplexF32 , 2 , 3 )
77 a_re = Reactant. to_rarray (a)
88
99 f = ein " ij->"
@@ -23,7 +23,7 @@ using OMEinsum
2323end
2424
2525@testset " trace" begin
26- a = Reactant. TestUtils. construct_test_array (ComplexF64 , 3 , 3 )
26+ a = Reactant. TestUtils. construct_test_array (ComplexF32 , 3 , 3 )
2727 a_re = Reactant. to_rarray (a)
2828
2929 f = ein " ii->"
3333end
3434
3535@testset " transpose" begin
36- a = Reactant. TestUtils. construct_test_array (ComplexF64 , 2 , 3 )
36+ a = Reactant. TestUtils. construct_test_array (ComplexF32 , 2 , 3 )
3737 a_re = Reactant. to_rarray (a)
3838
3939 f = ein " ij->ji"
4040 c = f (a)
4141 c_re = @jit f (a_re)
4242 @test c ≈ c_re
4343
44- a = Reactant. TestUtils. construct_test_array (ComplexF64 , 2 , 3 , 4 , 5 )
44+ a = Reactant. TestUtils. construct_test_array (ComplexF32 , 2 , 3 , 4 , 5 )
4545 a_re = Reactant. to_rarray (a)
4646
4747 f = ein " ijkl->jilk"
5151end
5252
5353@testset " matmul" begin
54- a = Reactant. TestUtils. construct_test_array (ComplexF64 , 2 , 3 )
55- b = Reactant. TestUtils. construct_test_array (ComplexF64 , 3 , 4 )
54+ a = Reactant. TestUtils. construct_test_array (ComplexF32 , 2 , 3 )
55+ b = Reactant. TestUtils. construct_test_array (ComplexF32 , 3 , 4 )
5656 a_re = Reactant. to_rarray (a)
5757 b_re = Reactant. to_rarray (b)
5858
6363end
6464
6565@testset " hadamard product" begin
66- a = Reactant. TestUtils. construct_test_array (ComplexF64 , 2 , 3 )
67- b = Reactant. TestUtils. construct_test_array (ComplexF64 , 2 , 3 )
66+ a = Reactant. TestUtils. construct_test_array (ComplexF32 , 2 , 3 )
67+ b = Reactant. TestUtils. construct_test_array (ComplexF32 , 2 , 3 )
6868 a_re = Reactant. to_rarray (a)
6969 b_re = Reactant. to_rarray (b)
7070
7373 c_re = @jit f (a_re, b_re)
7474 @test c ≈ c_re
7575
76- b = Reactant. TestUtils. construct_test_array (ComplexF64 , 3 , 2 )
76+ b = Reactant. TestUtils. construct_test_array (ComplexF32 , 3 , 2 )
7777 b_re = Reactant. to_rarray (b)
7878 f = ein " ij,ji->ij"
7979 c = f (a, b)
8282end
8383
8484@testset " inner product" begin
85- a = Reactant. TestUtils. construct_test_array (ComplexF64 , 4 , 3 )
86- b = Reactant. TestUtils. construct_test_array (ComplexF64 , 3 , 4 )
85+ a = Reactant. TestUtils. construct_test_array (ComplexF32 , 4 , 3 )
86+ b = Reactant. TestUtils. construct_test_array (ComplexF32 , 3 , 4 )
8787 a_re = Reactant. to_rarray (a)
8888 b_re = Reactant. to_rarray (b)
8989
9494end
9595
9696@testset " outer product" begin
97- a = Reactant. TestUtils. construct_test_array (ComplexF64 , 2 , 3 )
98- b = Reactant. TestUtils. construct_test_array (ComplexF64 , 4 , 5 )
97+ a = Reactant. TestUtils. construct_test_array (ComplexF32 , 2 , 3 )
98+ b = Reactant. TestUtils. construct_test_array (ComplexF32 , 4 , 5 )
9999 a_re = Reactant. to_rarray (a)
100100 b_re = Reactant. to_rarray (b)
101101
116116end
117117
118118@testset " scale" begin
119- a = Reactant. TestUtils. construct_test_array (ComplexF64 , 2 , 3 )
120- b = ComplexF64 [2.0 ]
119+ a = Reactant. TestUtils. construct_test_array (ComplexF32 , 2 , 3 )
120+ b = ComplexF32 [2.0 ]
121121 a_re = Reactant. to_rarray (a)
122122 b_re = Reactant. to_rarray (b)
123123
128128end
129129
130130@testset " batch matmul" begin
131- a = Reactant. TestUtils. construct_test_array (ComplexF64 , 2 , 3 , 6 )
132- b = Reactant. TestUtils. construct_test_array (ComplexF64 , 3 , 4 , 6 )
131+ a = Reactant. TestUtils. construct_test_array (ComplexF32 , 2 , 3 , 6 )
132+ b = Reactant. TestUtils. construct_test_array (ComplexF32 , 3 , 4 , 6 )
133133 a_re = Reactant. to_rarray (a)
134134 b_re = Reactant. to_rarray (b)
135135
145145end
146146
147147@testset " tensor contraction" begin
148- a = Reactant. TestUtils. construct_test_array (ComplexF64 , 2 , 4 , 3 )
149- b = Reactant. TestUtils. construct_test_array (ComplexF64 , 4 , 5 , 3 )
148+ a = Reactant. TestUtils. construct_test_array (ComplexF32 , 2 , 4 , 3 )
149+ b = Reactant. TestUtils. construct_test_array (ComplexF32 , 4 , 5 , 3 )
150150 a_re = Reactant. to_rarray (a)
151151 b_re = Reactant. to_rarray (b)
152152
0 commit comments