Skip to content

Change Gather and Slice's attributes into intputs

Houssem ROUIS requested to merge hrouis/aidge_core:fix_gather_and_slice into dev

Context

For Gather and Slice Operator, we didn't keep the same standard as ONNX, some of the inputs were made attributes on Aidge. However these inputs might not be initializers on the onnx model, so loading these attributes while importing the onnx model is not possible. This is why this MR is intending to make those attributes into back into inputs so we don't have to load them while creating the nodes. For Gather operator:

  • Indices
  • GatheredShape For Slice:
  • Starts
  • Ends
  • Axes

Modified files

  • Slice.hpp remove 'Starts', 'Ends', 'Axes' attributes and add them as inputs.
  • Slice.cpp change computeOutputDims() to use inputs instead of attrs.
  • pybind_Slice.cpp remove 'Starts', 'Ends', 'Axes' arguments from the binded constructor.
  • HorizontalTiling.cpp remove 'Starts', 'Ends', 'Axes' arguments from slice node creation and replace them with Producers input nodes.
  • Gather.cppremove 'Indices' and 'GatheredShape' attributes and add them as inputs.
  • Gather.cpp change computeOutputDims() to use inputs instead of attrs.
  • pybind_Gather.cppremove 'Indices' and 'GatheredShape' arguments from the binded constructor.

TODO

(List the changes that need to be done to track the progress of the MR, you need to update the list when committing !)

  • DONE : replace 'Indices' and 'GatheredShape' attributes with inputs for Gather operator.
  • DONE : replace 'Starts', 'Ends', 'Axes' attributes with inputs for Slice operator.
  • TO DO : find a better way to cast inputs in computeOutputDims() of Slice
  • DONE : fix HorizontalTiling recipe
Edited by Houssem ROUIS

Merge request reports