In the torch.trace tutorial, it says if we don’t do jit.script in some if-else logic statement in the model, the exported trace model won’t capture it. However, in ONNX, does it mean we don’t need to do jit.script in those logic statements in the model?
ONNX export leverage TorchIR to convert PyTorch model to ONNX graph. TorchIR is generated by trace or script, so you will still have the same limitation if you use trace to export to ONNX.
What the problem of using script to capture control flow and loop?