Skip to content

Commit 061d34b

Browse files
committed
update code
1 parent d54c1c5 commit 061d34b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

deepxde/gradients/jacobian.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ def __call__(self, ys, xs, i=None, j=None):
114114
# x = torch.from_numpy(x)
115115
# x.requires_grad_()
116116
# f(x)
117-
if backend_name in ["tensorflow.compat.v1", "tensorflow"]:
117+
if backend_name == "tensorflow.compat.v1":
118+
key = (ys.ref(), xs.ref())
119+
elif backend_name == "tensorflow":
118120
if config.autodiff == "reverse":
119121
key = (ys.ref(), xs.ref())
120122
elif config.autodiff == "forward":

0 commit comments

Comments
 (0)