Does PyTorch support if-while statements when exporting to ONNX model

my model have if-else or while statements in foward, does PyTorch support such control statements?

Yes as long as you export your model using the script based exporter torch.onnx — PyTorch master documentation