Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No proper error message for autodiff not supporting to_numpy and from_numpy #4473

Closed
erizmr opened this issue Mar 8, 2022 · 1 comment
Closed
Labels
autodiff This issue is related to automatic differentiation system potential bug Something that looks like a bug but not yet confirmed

Comments

@erizmr
Copy link
Contributor

erizmr commented Mar 8, 2022

Describe the bug
No proper error message for autodiff not supporting to_numpy and from_numpy.
The reason for this bug is that autodiff not supporting external arrary currently, the dest of a GlobalStoreStmt cannot be a ExternalPtrStmt , thus an assertion failure raised.

To Reproduce

import taichi as ti

ti.init()
a = ti.field(dtype=float, shape=(), needs_grad=True)
loss = ti.field(dtype=float, shape=(), needs_grad=True)

def func():
  b = a.to_numpy()
  print(b)

with ti.Tape(loss=loss):
  func()
	

Log/Screenshots
image

Additional comments
Related issue #4267 .

@erizmr erizmr added the potential bug Something that looks like a bug but not yet confirmed label Mar 8, 2022
@erizmr erizmr added the autodiff This issue is related to automatic differentiation system label Mar 15, 2022
@erizmr
Copy link
Contributor Author

erizmr commented Aug 6, 2022

Fixed by #5630.

@erizmr erizmr closed this as completed Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autodiff This issue is related to automatic differentiation system potential bug Something that looks like a bug but not yet confirmed
Projects
None yet
Development

No branches or pull requests

1 participant