@@ -176,22 +176,38 @@ end
176
176
end
177
177
178
178
@testset " findfirst / findlast" begin
179
- x = rand (Bool, 3 , 4 )
179
+ x = Bool[
180
+ 0 0 0 0
181
+ 1 0 1 0
182
+ 0 1 0 1
183
+ ]
180
184
x_ra = Reactant. to_rarray (x)
181
185
182
186
ffirstlinindices (x) = LinearIndices (x)[findfirst (x)]
183
187
ffirstlinindices (f, x) = LinearIndices (x)[findfirst (f, x)]
184
188
flastlinindices (x) = LinearIndices (x)[findlast (x)]
185
189
flastlinindices (f, x) = LinearIndices (x)[findlast (f, x)]
186
190
187
- @test ffirstlinindices (x) ≈ @jit (findfirst (x_ra))
188
- @test flastlinindices (x) ≈ @jit (findlast (x_ra))
189
-
190
- x = rand (1 : 256 , 3 , 4 )
191
- x_ra = Reactant. to_rarray (x)
192
-
193
- @test ffirstlinindices (iseven, x) ≈ @jit (findfirst (iseven, x_ra))
194
- @test flastlinindices (iseven, x) ≈ @jit (findlast (iseven, x_ra))
191
+ @test ffirstlinindices (x) ≈ @jit (findfirst (x_ra)) broken = contains (
192
+ string (Reactant. devices ()[1 ]), " TPU"
193
+ )
194
+ @test flastlinindices (x) ≈ @jit (findlast (x_ra)) broken = contains (
195
+ string (Reactant. devices ()[1 ]), " TPU"
196
+ )
197
+
198
+ x = Int64[
199
+ 3 5 7 9
200
+ 4 6 7 8
201
+ 5 7 8 9
202
+ ]
203
+ x_ra = Reactant. to_rarray (x)
204
+
205
+ @test ffirstlinindices (iseven, x) ≈ @jit (findfirst (iseven, x_ra)) broken = contains (
206
+ string (Reactant. devices ()[1 ]), " TPU"
207
+ )
208
+ @test flastlinindices (iseven, x) ≈ @jit (findlast (iseven, x_ra)) broken = contains (
209
+ string (Reactant. devices ()[1 ]), " TPU"
210
+ )
195
211
end
196
212
197
213
@testset " approx top k lowering" begin
0 commit comments