Skip to content

Syntax error in Python 2.7 #1

@kastnerkyle

Description

@kastnerkyle

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions