zhiics 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_r368052016
 
 

 ##########
 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:
   @MarisaKirisame Are you saying why I used the map here? I was trying to 
leverage VM Clousre which saves the evaluated values of the captured free vars.
   
   @icemelon9 we can probably have a destructor to clean the allocated closures 
in the map. Another way is probably just to have a base `ClosureObj` class and 
let `VMClosureObj` and `InterpreterClosureObj` inherit from it so most of 
original code here keep unchanged. How do you think?

----------------------------------------------------------------
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