autoptim
autoptim copied to clipboard
Syntax error in Python 2.7
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!