Ubospica opened a new pull request, #14764:
URL: https://github.com/apache/tvm/pull/14764

   This PR enhances the relax::CopyWithNewVars util by adding a `var_map_` 
member to the `FuncCopier` class. 
   
   And the FuncCopier pass is moved to `src/relax/transform/utils.h` to include 
it in other C++ source files. 
   
   Therefore, we can know the variable mapping from the old function to the new 
function. To use this you will need to:
   
   ```
   // only copying a function
   #include <tvm/relax/utils.h>
   auto func = CopyWithNewVars(old_func);
   
   // getting the var_map_ while copying the function
   #include "src/relax/transform/utils.h"
   auto copier = FuncCopier();
   auto func = copier.Transform(old_func);
   Map<Var, Var> var_map = copier.var_map;
   ```


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

Reply via email to