Export PyTorch model to onnx object without the intermediate saving and loading of an .onnx file

While torch.onnx.export(model, input, 'model.onnx') saves to a file, is there a way I can get the model instead of loading it back again as onnx_model = onnx.load('model.onnx') ? TIA