manupa-arm commented on code in PR #11091:
URL: https://github.com/apache/tvm/pull/11091#discussion_r864823847
##########
src/relay/backend/aot_executor_codegen.cc:
##########
@@ -215,11 +217,21 @@ class AOTOnDemandAllocator : public
transform::DeviceAwareExprVisitor {
* \return The corresponding token.
*/
StorageInfo GetStorage(const Expr& expr) {
+ Expr true_expr = expr;
+
+ // Don't get storage for let nodes.
+ while (const auto* let_node = true_expr.as<LetNode>()) {
Review Comment:
I was thinking instead of :
```
void PreVisitLetBinding_(const Var& var, const Expr& value) final {
LOG(FATAL) << "let is not supported.";
VisitExpr(value);
StorageInfo si = GetStorage(value);
storage_device_map_[var] = si;
}
```
if we do PostVisitLet, wont we have the same effect (i.e. the body is
visited)?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]