Tutuorials about how to design the models able to export

Any tutorials of pytorch, to teach us how could we develop model able to export by

torch.jit.script(model, img)
torch.jit.trace(model, img)

Not all of the models can export by those cmd directly, do the communties have some tutorials to give us some recommendations of writing “model easy to deploy”?Thanks

The torchscript tutorial is not bad Introduction to TorchScript — PyTorch Tutorials 1.10.1+cu102 documentation

Generally you want to avoid for loops or if conditions or custom operations