【Hackathon 9th No.17、18】 Fix accuracy diff for conv2d_transpose API with NHWC format #75141
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Category
Operator Mechanism
PR Types
Bug Fixes
Description
问题描述
data_format="NHWC"且padding >0的用例仍存在问题。conv2d_transposeAPI 在 NHWC 数据格式下的梯度计算错误。当使用data_format="NHWC"且padding > 0时,反向传播的梯度会出现错误的行偏移,导致梯度传播到错误的位置。根本原因
问题出现在
paddle/phi/kernels/funcs/im2col_cfo_cpu.h文件的im2col_sh1sw1dh1dw1ph1pw1函数中。NHWC分支使用了错误的索引计算:
单测以及PaddleAPITest回测的结果
单元测试结果:
PaddleAPITest回测结果: