Skip to content

Fix pybind classmethod

Maxence Naud requested to merge fix_pybind_classmethod into dev

Context

static operator method badly bounded.

>>> import aidge_core as ac

>>> my_fc = ac.FC(10,10)
>>> my_fc.get_operator().get_inputs_name() # error
# TypeError: get_inputs_name(): incompatible function arguments. The following argument types are supported:
#     1. () -> List[str]

However, calling the method as a classmethod works

>>> ac.FCOp.get_inputs_name() # OK
# ['data_input', 'weight', 'bias']

For the first call to work as intended, static functions should be bounded using def_static instead of def

Modified files

Many files in python_binding/operator/

Merge request reports