Skip to content

Commit

Permalink
[Autodiff]: update ti.ad.no_grad tests and remove comment
Browse files Browse the repository at this point in the history
  • Loading branch information
shwnyao committed Apr 12, 2022
1 parent b97a732 commit 74d79c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion python/taichi/ad.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def no_grad(func):
>>> def foo(a):
>>> multiply(a)"""
def decorated(*args, **kwargs):
# TODO [#3025]: get rid of circular imports and move this to the top.
impl.get_runtime().grad_replaced = True
if impl.get_runtime().target_tape:
impl.get_runtime().target_tape.insert(decorated, args)
Expand Down
3 changes: 2 additions & 1 deletion tests/python/test_customized_grad.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ def forward(mul):

with ti.Tape(loss=total):
forward(4)
assert x.grad[0] == 0
func(5)
assert x.grad[0] == 5


@test_utils.test()
Expand Down

0 comments on commit 74d79c2

Please sign in to comment.