Hi All,
I am curious to understand the reasoning behind https://github.com/pytorch/pytorch/blob/v1.2.0/torch/csrc/jit/passes/python_print.cpp#L788? Why would jit module export not support multiple values? I also see that the python-c++ interface is only returning at the last element in the stack vector (stack.back()) when we invoke a scriptmodule from python, but why this limitation? Why not return all elements in the stack vector? I am surely missing more technical details and would love to understand this further.
We follow the same conventions as Python here, if a function has multiple return values they all get wrapped up into a tuple, so it’s actually only 1 return value.
You can have as many returns as you want, they will just be wrapped into a tuple that you will have to unpack.