Skip to content

Commit d6ab70c

Browse files
langoscohawkinsp
andauthored
Fix minor typo in cell (#2692)
* Fix minor typo in cell One of the arguments to `hvp` wasn't being used, which made the example slightly confusing. * Fix both definitions of hvp in the autodiff cookbook. Co-authored-by: Peter Hawkins <[email protected]>
1 parent 7f6ede1 commit d6ab70c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/notebooks/autodiff_cookbook.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@
462462
"outputs": [],
463463
"source": [
464464
"def hvp(f, x, v):\n",
465-
" return grad(lambda x: np.vdot(grad(f)(x), v))"
465+
" return grad(lambda x: np.vdot(grad(f)(x), v))(x)"
466466
]
467467
},
468468
{
@@ -899,7 +899,7 @@
899899
"outputs": [],
900900
"source": [
901901
"def hvp(f, x, v):\n",
902-
" return grad(lambda x: np.vdot(grad(f)(x), v))"
902+
" return grad(lambda x: np.vdot(grad(f)(x), v))(x)"
903903
]
904904
},
905905
{

0 commit comments

Comments
 (0)