Skip to content

Commit

Permalink
update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry-Jzy committed Dec 25, 2024
1 parent 00a7be5 commit 2f4e340
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion deepxde/gradients/gradients_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ def grad_fn(x):
# In backend tensorflow/pytorch/jax, a tuple of a tensor/tensor/array
# and a callable is returned, so that it is consistent with the argument,
# which is also a tuple. This is useful for further computation, e.g.,
# Hessian. The code still works even the output dim is > 2.
# Hessian. The code is designed for the output shape of (batch size, dim),
# but we find that the code also works for the output shape of (batch size 1,
# batch size 2, dim) such as multiple-output DeepONet.
self.J[i, j] = (
self.J[j][0][..., i : i + 1],
lambda x: self.J[j][1](x)[i : i + 1],
Expand Down

0 comments on commit 2f4e340

Please sign in to comment.