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

[autodiff] Print more specific error message that autodiff does not support to_numpy #5630

Merged
merged 6 commits into from
Aug 6, 2022
6 changes: 6 additions & 0 deletions taichi/transforms/auto_diff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,9 @@ class MakeAdjoint : public ADTransform {

void visit(GlobalLoadStmt *stmt) override {
// issue global store to adjoint
if (stmt->src->is<ExternalPtrStmt>()) {
TI_ERROR("Src of GlobalLoadStmt does not support ExternalPtrStmt now.")
erizmr marked this conversation as resolved.
Show resolved Hide resolved
}
GlobalPtrStmt *src = stmt->src->as<GlobalPtrStmt>();
TI_ASSERT(src->width() == 1);
auto snodes = src->snodes;
Expand All @@ -1008,6 +1011,9 @@ class MakeAdjoint : public ADTransform {

void visit(GlobalStoreStmt *stmt) override {
// erase and replace with global load adjoint
if (stmt->dest->is<ExternalPtrStmt>()) {
TI_ERROR("Dest of GlobalStoreStmt does not support ExternalPtrStmt now.")
}
GlobalPtrStmt *dest = stmt->dest->as<GlobalPtrStmt>();
TI_ASSERT(dest->width() == 1);
auto snodes = dest->snodes;
Expand Down