Skip to content

backend registration and adaptation improvements

Olivier BICHLER requested to merge adaptany into dev
  • Added ability to specify same Any for data type and format (using Any_1, Any_2, ...);
  • Do not populate prodConso when calling resetConsummerProducer(), as this causes great confusion for the user who can get missing implementation errors right upon creation of a Scheduler, even before calling forward();
  • Handle lambda function in registration (instead of attributes and possibility size). Keeping size as a I/O spec to allow automated operator tiling in backend adaptation in the future;
  • Change Tensor toDFormat() to be able to force a data type when the data is interpretable as 1) a list of values following the dimension or 2) a dimension index;
  • Adapt Tensor toDFormat() to change perform values permutation of index change;
  • Specify in Operator toDFormat() when to force data format;
  • Add a Scatter operator to handle the case 1) and use the Select operator for the case 2) in adaptToBackend();
  • Make graph adaptation in adaptToBackend() to handle these cases.

Fixes:

Usage example:

@ExportLibCpp.register("Resize", 
    aidge_core.ImplSpec(
        [ # Input specifications
            aidge_core.IOSpec(aidge_core.dtype.any, aidge_core.dformat.nhwc),
            aidge_core.IOSpec(aidge_core.dtype.any, aidge_core.dformat.any),
            aidge_core.IOSpec(aidge_core.dtype.any, aidge_core.dformat.any)
        ],
        [ # Output specifications
            aidge_core.IOSpec(aidge_core.dtype.any, aidge_core.dformat.nhwc)
        ],
        [aidge_core.mandatory_attrs(aidge_core.DynamicAttributes({"interpolation_mode": aidge_core.Interpolation.Mode.CUBIC}))]
    ))

There are 4 pre-defined lambda:

  • aidge_core.mandatory_attrs();
  • aidge_core.preferred_attrs();
  • aidge_core.mandatory_inherited_attrs();
  • aidge_core.preferred_inherited_attrs().
Edited by Olivier BICHLER

Merge request reports

Loading