[Fleety_12][Precision Depth Alignment] Fix paddle.nn.functional.affine_grid forward and backward gradient calculation #76128
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
New features
Description
修改内容:
前向传播
生成基础网格:
仿射变换:
[N, H×W, 3] × [N, 3, 2] = [N, H×W, 2][N, D×H×W, 4] × [N, 4, 3] = [N, D×H×W, 3]反向传播
[N, 3, H×W] × [N, H×W, 2] = [N, 3, 2]→ 转置为 [N, 2, 3][N, 4, D×H×W] × [N, D×H×W, 3] = [N, 4, 3]→ 转置为 [N, 3, 4]两者遵循相同的计算模式:生成基础网格 → 应用仿射变换 → 输出变换后的网格坐标。
测试结果:
devPR:#76066