I have taken a look at Torchscript source code and in the “_construct” method of class RecursiveScriptModule (torch/jit/_script.py) there are some guiding comment lines that i dont really understand it.
PyTorch code should use this to construct a RecursiveScriptModule instead
__init__ directly, as it makes sure the
object is properly finalized (and in the future, we may take
control of how the RecursiveScriptModule instance is created).
Why _construct method can help to control the instance initialization instead of calling __init __ directly? Can someone explain and give me some examples for this?