|
75 | 75 | @test back(ones(size(X)))[1].X == ones(size(X))
|
76 | 76 | end
|
77 | 77 | end
|
| 78 | + @testset "input checks" begin |
| 79 | + D = 3; D⁻ = 2 |
| 80 | + N1 = 2; N2 = 3 |
| 81 | + x = [rand(rng, D) for _ in 1:N1] |
| 82 | + x⁻ = [rand(rng, D⁻) for _ in 1:N1] |
| 83 | + y = [rand(rng, D) for _ in 1:N2] |
| 84 | + xx = [rand(rng, D, D) for _ in 1:N1] |
| 85 | + xx⁻ = [rand(rng, D, D⁻) for _ in 1:N1] |
| 86 | + yy = [rand(rng, D, D) for _ in 1:N2] |
| 87 | + @test_nowarn KernelFunctions.validate_inplace_dims(zeros(N1, N2), x, y) |
| 88 | + @test_throws DimensionMismatch KernelFunctions.validate_inplace_dims(zeros(N1, N1), x, y) |
| 89 | + @test_throws DimensionMismatch KernelFunctions.validate_inplace_dims(zeros(N1, N2), x⁻, y) |
| 90 | + @test_nowarn KernelFunctions.validate_inplace_dims(zeros(N1, N1), x) |
| 91 | + @test_nowarn KernelFunctions.validate_inplace_dims(zeros(N1), x) |
| 92 | + @test_throws DimensionMismatch KernelFunctions.validate_inplace_dims(zeros(N2), x) |
| 93 | + |
| 94 | + @test_nowarn KernelFunctions.validate_inputs(x, y) |
| 95 | + @test_throws DimensionMismatch KernelFunctions.validate_inputs(x⁻, y) |
| 96 | + |
| 97 | + @test_nowarn KernelFunctions.validate_inputs(xx, yy) |
| 98 | + @test_nowarn KernelFunctions.validate_inputs(xx⁻, yy) |
| 99 | + end |
78 | 100 | end
|
0 commit comments