-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[xdoctest] reformat example code with google style in No. 301 #56599
Conversation
... return image, label | ||
... def __len__(self): | ||
... return self.num_samples | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要直接空行,用 ...
,不然会认为是两段代码,下同
|
||
sgd = paddle.optimizer.SGD(learning_rate=0.1,parameters=linear.parameters()) | ||
>>> sgd = paddle.optimizer.SGD(learning_rate=0.1,parameters=linear.parameters()) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... min_average_window=2, | ||
... max_average_window=4) | ||
>>> sgd.step() | ||
>>> modelaverage.step() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print(param) | ||
>>> with modelaverage.apply(need_restore=False): | ||
... for param in linear.parameters(): | ||
... print(param) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for param in linear.parameters(): | ||
print(param) | ||
>>> for param in linear.parameters(): | ||
... print(param) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
modelaverage.restore() | ||
>>> modelaverage.restore() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yuchen202 你认领的301,张师傅已经做完了,请不要做重复了 |
噢噢,我把我那个py文件删了 |
…Paddle#56599) * Update private_helper_function.py * xdoc * Apply suggestions from code review * format and skip a to_static case * add a missing space --------- Co-authored-by: SigureMo <sigure.qaq@gmail.com>
PR types
Others
PR changes
Others
Description
#55629