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

   Previously, if we have a Torch model with multiple return values like:
   ```
   class Mod(nn.Module):
       ...
       def forward(...):
           ...
           return logits, loss
   ```
   The translator will always bind the return tuple to a Relax var and return 
it:
   ```
       gv: R.Tuple(...) = (logits, loss)
       return gv
   ```
   This brings inconvenience if we want to use `Gradient` pass to set the loss 
as the target (i.e. set `target_index=1`). Because if the return value is a 
single Relax var, the `Gradient` pass will not take it as multiple return 
values.
   
   This PR brings a flag to let user choose between different return styles. If 
the user set `no_bind_return_tuple = True`, they will get
   ```
       return (logits, loss)
   ```


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