Skip to content
Snippets Groups Projects

Fix pybind classmethod

Merged 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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading