Skip to content

[API Compatibility No.186] Keep target for torch.nn.functional.mse_loss in PaConvert#845

Closed
Aidenwu0209 wants to merge 2 commits into
PaddlePaddle:masterfrom
Aidenwu0209:api-compat-76301-no186-mse-loss-target-alias
Closed

[API Compatibility No.186] Keep target for torch.nn.functional.mse_loss in PaConvert#845
Aidenwu0209 wants to merge 2 commits into
PaddlePaddle:masterfrom
Aidenwu0209:api-compat-76301-no186-mse-loss-target-alias

Conversation

@Aidenwu0209

@Aidenwu0209 Aidenwu0209 commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

PR Category

User Experience

PR Types

New features

PR Docs

PR APIs

torch.nn.functional.mse_loss

Description

  • Remove kwargs_change: {target: label} from torch.nn.functional.mse_loss mapping.
  • Keep SizeAverageMatcher behavior for size_average/reduce/reduction, while preserving PyTorch-style target in converted Paddle code.
  • This aligns with Paddle side alias support: paddle.nn.functional.mse_loss(target=...).

@paddle-bot

paddle-bot Bot commented Mar 5, 2026

Copy link
Copy Markdown

Thanks for your contribution!

@Aidenwu0209

Copy link
Copy Markdown
Contributor Author

@luotao1 CI通过了~

@luotao1 luotao1 changed the title [API Compatibility No.186] Keep target for torch.nn.functional.mse_loss in PaConvert -part [API Compatibility No.186] Keep target for torch.nn.functional.mse_loss in PaConvert Mar 24, 2026
Comment thread paconvert/api_mapping.json Outdated
@@ -9445,9 +9445,6 @@
"reduce",
"reduction"
],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread tests/test_nn_functional_mse_loss.py Outdated
"""
)
obj.run(pytorch_code, ["result"])
expect_paddle_code = textwrap.dedent(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个要改成实际运行的形式来测,参考开发流程

@CLAassistant

CLAassistant commented Mar 25, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Aidenwu0209 Aidenwu0209 force-pushed the api-compat-76301-no186-mse-loss-target-alias branch from e4107a2 to d73229d Compare March 25, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers HappyOpenSource 快乐开源活动issue与PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants