With ONNX export, does it mean it will avoid the problem when not using jit.script in torch.trace?

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?

Thank you for answering.

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?

I guess it is kind of like underdevelopment.