def METHOD_NAME():
    """Test that an error is thrown with invalid torchscript method."""
    model = BoringModel()
    model.train(True)
    with pytest.raises(ValueError, match="only supports 'script' or 'trace'"):
        model.to_torchscript(method="temp")