Skip to content

Commit e541fc2

Browse files
enable doctest in ad.py
1 parent 59ac746 commit e541fc2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ppsci/autodiff/ad.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ def __call__(
8585
8686
Examples:
8787
>>> import ppsci
88-
>>> x = paddle.randn([4, 3])
88+
>>> x = paddle.randn([4, 1])
8989
>>> x.stop_gradient = False
90-
>>> y = (x * x).sum()
91-
>>> dy_dx = ppsci.autodiff.jacoian(y, x) # doctest: +SKIP
90+
>>> y = x * x
91+
>>> dy_dx = ppsci.autodiff.jacobian(y, x)
9292
"""
9393
key = (ys, xs)
9494
if key not in self.Js:
@@ -187,7 +187,7 @@ def __call__(
187187
>>> x = paddle.randn([4, 3])
188188
>>> x.stop_gradient = False
189189
>>> y = (x * x).sin()
190-
>>> dy_dxx = ppsci.autodiff.hessian(y, x, component=0) # doctest: +SKIP
190+
>>> dy_dxx = ppsci.autodiff.hessian(y, x, component=0)
191191
"""
192192
key = (ys, xs, component)
193193
if key not in self.Hs:

0 commit comments

Comments
 (0)