Skip to content

Commit

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

The the grad field of variable at the left side of the global store will
be cleared after #6579. Change to atomic add sort the issue.
  • Loading branch information
erizmr authored Dec 10, 2022
1 parent 46ed67d commit bd54211
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 bd54211

Please sign in to comment.