Skip to content

DynamicAttributes refactor

Olivier BICHLER requested to merge dynattr_refactor into dev

This MR adds attributes (DynamicAttributes) to nodes and make them accessible from operators (as inheritedAttributes). It also includes some improvements of the DynamicAttributes class.

  • Use a single mAttrs map common to C++ and Python (as suggested in eclipse/aidge/aidge_core#147 by @cguillon, however this does not really permit a clean separation with PyBind for now);
  • Fix possible segfault at exit because of py::object (@mick94 this will solve your issue);
  • Added a DynamicAttributes member to Node:
    • Node name is now an optional attribute (named "name");
    • Added a mechanism to pass Node attribute to the Operator (called "inheritedAttributes");
    • Attribute namespace "impl" is automatically passed to the implementation requirements (ImplSpec);
    • @cguillon I think this may be interesting for you.
  • Implement hashable DynamicAttributes.

API change:

  • T getAttr() const returns a copy instead of a const reference.
Edited by Olivier BICHLER

Merge request reports

Loading