Skip to content

Commit fa119e1

Browse files
committed
Update
1 parent 373d5ad commit fa119e1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Nonlinear/ReverseAD/reverse_mode.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ function _forward_eval(
248248
end
249249
elseif node.type == Nonlinear.NODE_CALL_UNIVARIATE
250250
child_idx = children_arr[f.adj.colptr[k]]
251-
ret_f, ret_f′ = Nonlinear.eval_univariate_function_and_gradient(
251+
ret_f, ret_f′ = Nonlinear.eval_univariate_function_and_gradient(
252252
operators,
253253
node.index,
254254
f.forward_storage[child_idx],

test/Nonlinear/Nonlinear.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ function test_eval_univariate_function()
365365
(:-, 1.0, -1.0),
366366
(:abs, -1.1, 1.1),
367367
(:abs, 1.1, 1.1),
368+
(:sin, 1.1, sin(1.1)),
368369
]
369370
id = r.univariate_operator_to_id[op]
370371
@test Nonlinear.eval_univariate_function(r, op, x) == y
@@ -380,6 +381,7 @@ function test_eval_univariate_gradient()
380381
(:-, 1.2, -1.0),
381382
(:abs, -1.1, -1.0),
382383
(:abs, 1.1, 1.0),
384+
(:sin, 1.1, cos(1.1)),
383385
]
384386
id = r.univariate_operator_to_id[op]
385387
@test Nonlinear.eval_univariate_gradient(r, op, x) == y
@@ -395,6 +397,7 @@ function test_eval_univariate_function_and_gradient()
395397
(:-, 1.2, (-1.2, -1.0)),
396398
(:abs, -1.1, (1.1, -1.0)),
397399
(:abs, 1.1, (1.1, 1.0)),
400+
(:sin, 1.1, (sin(1.1), cos(1.1))),
398401
]
399402
id = r.univariate_operator_to_id[op]
400403
@test Nonlinear.eval_univariate_function_and_gradient(r, op, x) == y

0 commit comments

Comments
 (0)