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
221
221
using LinearAlgebra
222
222
223
223
function 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]
229
225
end
230
226
231
227
randvar = 1
232
228
function partial_nondet_returning (x)
233
229
global randvar
234
- y = Matrix {Float64} (undef, 5 , 5 )
235
- y .= randvar
230
+ y = Float64[randvar, x]
236
231
randvar += 1
237
- y = Hermitian (y)
238
- y .= x
239
- return parent (y)
232
+ return y
240
233
end
241
234
242
235
@testset " jvp: Estimate step correctly for when some terms are nan/infinite" begin
243
236
fdm = FiniteDifferences. central_fdm (5 , 1 )
244
237
res = jvp (fdm, partial_nan_returning, (3.1 , 2.7 ))
245
- @test all ( Hermitian ( res) . ≈ 2.7 )
238
+ @test res[ 1 ] ≈ 2.7
246
239
247
240
res = jvp (fdm, partial_nondet_returning, (3.1 , 2.7 ))
248
- @test all ( Hermitian ( res) . ≈ 2.7 )
241
+ @test res[ 1 ] ≈ 2.7
249
242
end
You can’t perform that action at this time.
0 commit comments