backend registration and adaptation improvements
-
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 callingforward()
; -
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 theSelect
operator for the case 2) inadaptToBackend()
; -
Make graph adaptation in adaptToBackend()
to handle these cases.
Fixes:
-
Fix #312 (closed): introduction of Any_1
,Any_2
, ... -
Fix aidge_export_cpp#48 (closed). -
Fix aidge_export_cpp#50 (closed): handled in setDataFormat()
rather thanadaptToBackend()
; -
Fix aidge_export_cpp#51 (closed).
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