[Fix] Tensor::setDataFormat handling of DataFormat::Default
Context
Fix aidge_backend_cpu#42 (closed)
Implement back the behaviour of setDataFormat lost in !314 (merged) that transposing Tensor from/to DataFormat::Default does not lead to any data transposition. Only the dataFormat is changed.
Major modification
- upd: in
DataFormat.hpp
, change 'getDataFormatTranspose' name to 'getPermutationMapping' - upd: use X-macro to keep DataFormat enum, string value, permutation with NCHW and description in synch
- add: number of dimensions information to X-macro
- upd: change 'DataFormatTransposeDict' array to 'permutationFromNCHW' and move it to a static function 'getPermutationFromNCHW'
- fix: do not transpose data in Tensor if current or new format is Default
Edited by Maxence Naud