autoptim icon indicating copy to clipboard operation
autoptim copied to clipboard

Syntax error in Python 2.7

Open kastnerkyle opened this issue 6 years ago • 0 comments

I get a syntax error using old Python 2.7 due to double splat unpacking in _scipy_func at this line:

obj = objective_function(*torch_vars, *args)

A fix that worked for me was to use functools.partial like so

of = partial(objective_function, *args)
obj = of(*torch_vars)

Thanks for the very handy library!

kastnerkyle avatar Feb 21 '19 08:02 kastnerkyle