[API Compatibility] align the loss apis --part (#78811)
* align the loss apis * fully aligned the loss apis * rename the param and merge the three decorators into one * reviewed and improved * 进一步简化 loss 系列 API 的 PyTorch 兼容方案:把每个 loss API 的 PyTorch 位置布局 与 PyTorch<->Paddle 参数别名 合并到一张 ``LEGACY_POS`` 表中,由 ``legacy_reduction_decorator`` 一次性完成位置 -> 关键字、关键字别名重命名、``size_average/reduce`` → ``reduction`` 的全部转换;同时移除,loss API 上多余的 ``@param_one_alias`` / ``@param_two_alias`` / ``@ParamAliasDecorator`` 装饰器 * simplify logic, refer to kwargs and positional args * kwargs are popped, positional values are fetched from the list at the indexed slot only when the value is a bool * mimic the logic of paconvert, one decorator per api. * fix * fix per feedback
W
Wenfei (Charles) Qi committed
3fc714de2ef1ea013a4710b93b3132009be88b87
Parent: 7c8a2cf
Committed by GitHub <noreply@github.com>
on 5/18/2026, 6:59:22 AM