File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -221,29 +221,22 @@ end
221221using LinearAlgebra
222222
223223function partial_nan_returning (x)
224- y = Matrix {Float64} (undef, 5 , 5 )
225- y .= NaN
226- y = Hermitian (y)
227- y .= x
228- return parent (y)
224+ return Float64[NaN , x]
229225end
230226
231227randvar = 1
232228function partial_nondet_returning (x)
233229 global randvar
234- y = Matrix {Float64} (undef, 5 , 5 )
235- y .= randvar
230+ y = Float64[randvar, x]
236231 randvar += 1
237- y = Hermitian (y)
238- y .= x
239- return parent (y)
232+ return y
240233end
241234
242235@testset " jvp: Estimate step correctly for when some terms are nan/infinite" begin
243236 fdm = FiniteDifferences. central_fdm (5 , 1 )
244237 res = jvp (fdm, partial_nan_returning, (3.1 , 2.7 ))
245- @test all ( Hermitian ( res) . ≈ 2.7 )
238+ @test res[ 1 ] ≈ 2.7
246239
247240 res = jvp (fdm, partial_nondet_returning, (3.1 , 2.7 ))
248- @test all ( Hermitian ( res) . ≈ 2.7 )
241+ @test res[ 1 ] ≈ 2.7
249242end
You can’t perform that action at this time.
0 commit comments