Skip to content

Commit

Permalink
[example] Fix jacobian example (taichi-dev#6849)
Browse files Browse the repository at this point in the history
Issue: taichi-dev#6733 

The the grad field of variable at the left side of the global store will
be cleared after taichi-dev#6579. Change to atomic add sort the issue.
  • Loading branch information
erizmr authored and quadpixels committed May 13, 2023
1 parent 44cfcd4 commit 6f4dda1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/taichi/examples/autodiff/jacobian.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
def func():
for j in range(N_loss):
for i in range(N_param):
losses[j] = ti.sin(j / 16 * np.pi) * ti.sin(
losses[j] += ti.sin(j / 16 * np.pi) * ti.sin(
i / 16 * np.pi) * params[i]


Expand Down

0 comments on commit 6f4dda1

Please sign in to comment.