How to use _forward_impl in my own model

I used torch.onnx.export to convert my model to onnx. My Module that is not a ScriptModule. that means the exported model will not capture this dynamic behavior,
so when I ran inference with the exported onnx model, I got the wrong predictions.
Using ScriptModule to rebuild my model is a huge work. I converted resnet50 to onnx, and can get the right output, the Resnet in pytorch is torch.nn.Module, I want to know how Resnet worls fine in onnx, and what’s the meaning of _forward_impl, and how to use _forward_impl.