Solves aidge#32 (closed).
To mark a function as deprecated, simply add the MACRO DEPRECATED("new_func_name");
at the beginning where "new_func_name"
is the name of the function that should be used instead.
Function name is automatically converted to snake_case if a Python environment is detected.
// in Tensor::setdataFormat()
DEPRECATED("toDataFormat");
>>> import aidge_core as ai
>>> ai.Tensor(dims=[1,2,3,4])
>>> a.set_data_format(ai.dformat.nchw)
[WARNING] - 'set_data_format()' is deprecated, please use 'to_data_format()' instead
Add macro when Python binded function name cannot be automatically deduced DEPRECATED_WITH_PYBIND_OVERRIDES
// in Tensor::setdataFormat()
DEPRECATED_WITH_PYBIND_OVERRIDES("toDataFormat", "set_dformat", "to_dformat");
>>> import aidge_core as ai
>>> ai.Tensor(dims=[1,2,3,4])
>>> a.set_dformat(ai.dformat.nchw)
[WARNING] - 'set_dformat()' is deprecated, please use 'to_dformat()' instead
utils/Deprecation.hpp
Copyright © Eclipse Foundation, Inc. All Rights Reserved. Privacy Policy | Terms of Use | Copyright Agent