Skip to content

Commit dce4b10

Browse files
committed
update comments
1 parent 3da1e28 commit dce4b10

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

deepxde/gradients/gradients.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ def jacobian(ys, xs, i=None, j=None):
3030
unless J has only one element, which is returned.
3131
3232
Returns:
33-
(`i`, `j`)th entry J[`i`, `j`], `i`th row J[`i`, :], or `j`th column J[:, `j`].
33+
(`i`, `j`)th entry J[`i`, `j`], `i`th row J[`i`, :], or `j`th column J[:, `j`],
34+
with 2 dimension when ys of shape (batch_size, dim_y) or 3 dimension when
35+
ys of shape (batch_size_out, batch_size, dim_y).
3436
"""
3537
if config.autodiff == "reverse":
3638
return gradients_reverse.jacobian(ys, xs, i=i, j=j)
@@ -59,7 +61,8 @@ def hessian(ys, xs, component=0, i=0, j=0):
5961
j (int): `j`th column.
6062
6163
Returns:
62-
H[`i`, `j`].
64+
H[`i`, `j`], with 2 dimension when ys of shape (batch_size, dim_y)
65+
or 3 dimension when ys of shape (batch_size_out, batch_size, dim_y).
6366
"""
6467
if config.autodiff == "reverse":
6568
return gradients_reverse.hessian(ys, xs, component=component, i=i, j=j)

0 commit comments

Comments
 (0)