Open archibate opened 4 years ago
The bug is gone after reverting #1906 @yuanming-hu
Would you revert it and remerge it into an experimental branch (like @Rullec did in rullec-field
) so it won't break master completely?
It's likely you didn't copy the primitive ptr in somewhere in ad system :( We'd better set up the test_examples asap to prevent hidden issues like this.
mrp:
import taichi as ti
# ti.init() # OK
# ti.reset() # OK
x = ti.field(float, (), needs_grad=True)
y = ti.field(float, (), needs_grad=True)
@ti.kernel
def func():
y[None] = 1 / x[None]
#y[None] = 1.0 / x[None] # OK
#y[None] = 1 + x[None] # OK
#y[None] = x[None] # OK
func.grad()
Why adding ti.reset()
fix the problem?
Why 1.0 / x[None]
fix the problem? Isn't promote_type working well?
I wonder if we actually should put ti.reset()
in the last line of taichi/__init__.py
?
Describe the bug Running
examples/ad_gravity.py
results inRuntimeError: Assertion failure: primitive
in latest master. But I can't reproduce this in v0.6.38 (latest stable).To Reproduce Just run
examples/ad_gravity.py
.Log/Screenshots Please post the full log of the program (instead of just a few lines around the error message, unless the log is > 1000 lines). This will help us diagnose what's happening. For example:
Additional comments If possible, please also consider attaching the output of command
ti diagnose
. This produces the detailed environment information and hopefully helps us diagnose faster.If you have local commits (e.g. compile fixes before you reproduce the bug), please make sure you first make a PR to fix the build errors and then report the bug.