Skip to content

Commit 862fcff

Browse files
committed
test: more tests broken
1 parent 575decf commit 862fcff

File tree

2 files changed

+27
-10
lines changed

2 files changed

+27
-10
lines changed

test/ops.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,8 @@ end
12271227
x_ra = Reactant.to_rarray(randn(Float32, 6, 6))
12281228
lu_ra, ipiv, perm, info = @jit Ops.lu(x_ra)
12291229

1230-
@test @jit(recon_from_lu(lu_ra)) @jit(getindex(x_ra, perm, :))
1230+
@test @jit(recon_from_lu(lu_ra)) @jit(getindex(x_ra, perm, :)) atol = 1e-5 rtol =
1231+
1e-2
12311232
end
12321233

12331234
@testset "batched" begin

test/sorting.jl

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,22 +176,38 @@ end
176176
end
177177

178178
@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+
]
180184
x_ra = Reactant.to_rarray(x)
181185

182186
ffirstlinindices(x) = LinearIndices(x)[findfirst(x)]
183187
ffirstlinindices(f, x) = LinearIndices(x)[findfirst(f, x)]
184188
flastlinindices(x) = LinearIndices(x)[findlast(x)]
185189
flastlinindices(f, x) = LinearIndices(x)[findlast(f, x)]
186190

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+
)
195211
end
196212

197213
@testset "approx top k lowering" begin

0 commit comments

Comments
 (0)