Skip to content

[API Compatibility No.154] add target alias for binary_cross_entropy -part#863

Open
Aidenwu0209 wants to merge 1 commit intoPaddlePaddle:masterfrom
Aidenwu0209:api-compat-76301-no154-bce-target-alias
Open

[API Compatibility No.154] add target alias for binary_cross_entropy -part#863
Aidenwu0209 wants to merge 1 commit intoPaddlePaddle:masterfrom
Aidenwu0209:api-compat-76301-no154-bce-target-alias

Conversation

@Aidenwu0209
Copy link
Copy Markdown
Contributor

PR Category

User Experience

PR Types

New features

Description

Support PyTorch-style target keyword usage for torch.nn.functional.binary_cross_entropy in PaConvert by keeping the converted Paddle call in prefix-only form.

Changes in this PR:

  • paconvert/api_mapping.json
    • Change torch.nn.functional.binary_cross_entropy from SizeAverageMatcher to ChangePrefixMatcher
    • Remove the target -> label keyword rewrite
  • tests/test_nn_functional_binary_cross_entropy.py
    • Add prefix-only conversion assertions for input= / target= usage
    • Add exact conversion assertions for legacy size_average / reduce call forms
    • Keep runnable alignment cases for supported call forms

Related Issue: PaddlePaddle/Paddle#76301 (No.154)

Related PRs:

@paddle-bot
Copy link
Copy Markdown

paddle-bot bot commented Apr 3, 2026

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant