Skip to content

[CodeStyle] Use pycon for code-block language marker - part9#77611

Merged
SigureMo merged 2 commits intoPaddlePaddle:developfrom
ShigureNyako:fix-docstring-initializer
Feb 1, 2026
Merged

[CodeStyle] Use pycon for code-block language marker - part9#77611
SigureMo merged 2 commits intoPaddlePaddle:developfrom
ShigureNyako:fix-docstring-initializer

Conversation

@ShigureNyako
Copy link
Contributor

@ShigureNyako ShigureNyako commented Jan 31, 2026

PR Category

User Experience

PR Types

Docs

Description

Change .. code-block:: python to .. code-block:: pycon when >>> is present.

This PR covers:

  • python/paddle/nn/initializer
  • python/paddle/nn/utils

@paddle-bot
Copy link

paddle-bot bot commented Jan 31, 2026

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Jan 31, 2026
@ShigureNyako ShigureNyako reopened this Jan 31, 2026
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

这个 PR 需要重新创建一个空的 commit 来触发 CI 了,比如

git commit -m "empty commit, trigger CI" --allow-empty

之后 push 上来即可

@SigureMo SigureMo changed the title [CodeStyle] Change python to pycon - part9 [CodeStyle] Use pycon for code-block language marker - part9 Jan 31, 2026
@ShigureNyako
Copy link
Contributor Author

/re-run all-failed

@ShigureNyako
Copy link
Contributor Author

/re-run all

@SigureMo
Copy link
Member

不要 rerun all 啊……只能 rerun all-failed,这不是全白跑了

@ShigureNyako
Copy link
Contributor Author

/re-run

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

static-check 有示例代码挂了诶,需要看看

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

LGTMeow 🐾

干得不错,聪明喵喵

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates documentation code blocks to use the pycon language marker instead of python when interactive Python console markers (>>>) are present. The changes cover files in python/paddle/nn/initializer and python/paddle/nn/utils directories.

Changes:

  • Updated code-block directives from python to pycon for 10 docstring examples containing interactive console markers
  • Added trailing commas to improve multi-line function call formatting consistency in several examples
  • Fixed incorrect array dimensions in assign.py examples (the weight/bias shapes now correctly match Linear layer expectations)

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
python/paddle/nn/utils/weight_norm_hook.py Changed code-block directive to pycon
python/paddle/nn/utils/spectral_norm_hook.py Changed code-block directive to pycon
python/paddle/nn/utils/clip_grad_norm_.py Changed code-block directive to pycon
python/paddle/nn/initializer/xavier.py Changed code-block directive to pycon and added trailing commas for style consistency
python/paddle/nn/initializer/orthogonal.py Changed code-block directive to pycon
python/paddle/nn/initializer/normal.py Changed code-block directive to pycon and added trailing commas for style consistency
python/paddle/nn/initializer/kaiming.py Changed code-block directive to pycon
python/paddle/nn/initializer/initializer.py Changed code-block directive to pycon
python/paddle/nn/initializer/bilinear.py Changed code-block directive to pycon and reformatted function calls for better readability
python/paddle/nn/initializer/assign.py Changed code-block directive to pycon and corrected array dimensions in examples to match Linear layer expectations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SigureMo SigureMo merged commit 1d6268b into PaddlePaddle:develop Feb 1, 2026
65 of 66 checks passed
@SigureMo SigureMo added the Agent label Feb 1, 2026
@SigureMo SigureMo deleted the fix-docstring-initializer branch February 1, 2026 08:25
@SigureMo SigureMo removed the contributor External developers label Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants