@@ -11,13 +11,17 @@ backends = [("Array", identity), ("JLArray", JLArray)]
1111 B1 = StridedView (make_arr (copy (data1)))
1212 B2 = StridedView (make_arr (copy (data2)))
1313
14- conj! (A1); conj! (B1)
14+ conj! (A1)
15+ conj! (B1)
1516 @test A1 ≈ Array (B1)
16- adjoint! (A2, A1); adjoint! (B2, B1)
17+ adjoint! (A2, A1)
18+ adjoint! (B2, B1)
1719 @test A2 ≈ Array (B2)
18- transpose! (A2, A1); transpose! (B2, B1)
20+ transpose! (A2, A1)
21+ transpose! (B2, B1)
1922 @test A2 ≈ Array (B2)
20- permutedims! (A2, A1, (2 , 1 )); permutedims! (B2, B1, (2 , 1 ))
23+ permutedims! (A2, A1, (2 , 1 ))
24+ permutedims! (B2, B1, (2 , 1 ))
2125 @test A2 ≈ Array (B2)
2226 end
2327 end
@@ -118,64 +122,42 @@ end
118122 @test Array (
119123 Strided. _mapreducedim! (
120124 sin, + , identity, (10 , 10 , 10 , 10 , 10 , 10 ),
121- (
122- sreshape (StridedView (R2c), (10 , 1 , 1 , 10 , 10 , 1 )),
123- StridedView (R1),
124- )
125+ (sreshape (StridedView (R2c), (10 , 1 , 1 , 10 , 10 , 1 )), StridedView (R1))
125126 )
126- ) ≈
127- mapreduce (sin, + , R1_cpu; dims = (2 , 3 , 6 )) .+ reshape (R2_cpu, (10 , 1 , 1 , 10 , 10 , 1 ))
127+ ) ≈ mapreduce (sin, + , R1_cpu; dims = (2 , 3 , 6 )) .+ reshape (R2_cpu, (10 , 1 , 1 , 10 , 10 , 1 ))
128128
129129 R2c = copy (R2)
130130 @test Array (
131131 Strided. _mapreducedim! (
132132 sin, + , x -> 0 , (10 , 10 , 10 , 10 , 10 , 10 ),
133- (
134- sreshape (StridedView (R2c), (10 , 1 , 1 , 10 , 10 , 1 )),
135- StridedView (R1),
136- )
133+ (sreshape (StridedView (R2c), (10 , 1 , 1 , 10 , 10 , 1 )), StridedView (R1))
137134 )
138- ) ≈
139- mapreduce (sin, + , R1_cpu; dims = (2 , 3 , 6 ))
135+ ) ≈ mapreduce (sin, + , R1_cpu; dims = (2 , 3 , 6 ))
140136
141137 R2c = copy (R2)
142138 β = rand (T)
143139 @test Array (
144140 Strided. _mapreducedim! (
145141 sin, + , x -> β * x, (10 , 10 , 10 , 10 , 10 , 10 ),
146- (
147- sreshape (StridedView (R2c), (10 , 1 , 1 , 10 , 10 , 1 )),
148- StridedView (R1),
149- )
142+ (sreshape (StridedView (R2c), (10 , 1 , 1 , 10 , 10 , 1 )), StridedView (R1))
150143 )
151- ) ≈
152- mapreduce (sin, + , R1_cpu; dims = (2 , 3 , 6 )) .+
153- β .* reshape (R2_cpu, (10 , 1 , 1 , 10 , 10 , 1 ))
144+ ) ≈ mapreduce (sin, + , R1_cpu; dims = (2 , 3 , 6 )) .+ β .* reshape (R2_cpu, (10 , 1 , 1 , 10 , 10 , 1 ))
154145
155146 R2c = copy (R2)
156147 @test Array (
157148 Strided. _mapreducedim! (
158149 sin, + , x -> β, (10 , 10 , 10 , 10 , 10 , 10 ),
159- (
160- sreshape (StridedView (R2c), (10 , 1 , 1 , 10 , 10 , 1 )),
161- StridedView (R1),
162- )
150+ (sreshape (StridedView (R2c), (10 , 1 , 1 , 10 , 10 , 1 )), StridedView (R1))
163151 )
164- ) ≈
165- mapreduce (sin, + , R1_cpu; dims = (2 , 3 , 6 ), init = β)
152+ ) ≈ mapreduce (sin, + , R1_cpu; dims = (2 , 3 , 6 ), init = β)
166153
167154 R2c = copy (R2)
168155 @test Array (
169156 Strided. _mapreducedim! (
170157 sin, + , conj, (10 , 10 , 10 , 10 , 10 , 10 ),
171- (
172- sreshape (StridedView (R2c), (10 , 1 , 1 , 10 , 10 , 1 )),
173- StridedView (R1),
174- )
158+ (sreshape (StridedView (R2c), (10 , 1 , 1 , 10 , 10 , 1 )), StridedView (R1))
175159 )
176- ) ≈
177- mapreduce (sin, + , R1_cpu; dims = (2 , 3 , 6 )) .+
178- conj .(reshape (R2_cpu, (10 , 1 , 1 , 10 , 10 , 1 )))
160+ ) ≈ mapreduce (sin, + , R1_cpu; dims = (2 , 3 , 6 )) .+ conj .(reshape (R2_cpu, (10 , 1 , 1 , 10 , 10 , 1 )))
179161
180162 R3_cpu = rand (T, (100 , 100 , 2 ))
181163 R3 = make_arr (copy (R3_cpu))
0 commit comments