icemelon9 commented on a change in pull request #4693: [runtime][refactor] 
Unify vm and interpreter objects
URL: https://github.com/apache/incubator-tvm/pull/4693#discussion_r367785178
 
 

 ##########
 File path: src/relay/backend/interpreter.cc
 ##########
 @@ -774,6 +751,14 @@ class Interpreter :
   // Cache ops that need to be frequently used later to reduce lookup overhead.
   const Op& debug_op_;
   const Op& shape_of_op_;
+  // The free vars captured by the last closure.
+  std::unordered_map<Closure, std::vector<Var>, ObjectHash, ObjectEqual> 
closure_captured_vars_;
 
 Review comment:
   One drawback using `closure_captured_vars_` is that the memory leak as it 
will never be released. I wonder if we should create a separate closure object 
for interpreter that inherits from `ClosureObj` and stores the captured var 
expr.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to