def test_model_saves_with_example_input_array(tmp_path, modelclass, input_sample):
    """Test that ONNX model saves with example_input_array and size is greater than 3 MB."""
    model = modelclass()
    model.example_input_array = input_sample

    file_path = os.path.join(tmp_path, "model.onnx")
    model.to_onnx(file_path)
    assert os.path.exists(file_path) is True
    assert os.path.getsize(file_path) > 4e2
Test that ONNX model saves with example_input_array and size is greater than 3 MB.
tests/tests_pytorch/models/test_onnx.py