Skip to content
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][task 142] Reformat example code with google style in quantization/quant_int8_mkldnn_pass.py #56239

Merged
merged 3 commits into from
Aug 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions python/paddle/static/quantization/quant_int8_mkldnn_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ def __init__(self, _scope=None, _place=None):

Examples:
.. code-block:: python
# The original graph will be rewrite.
import paddle.static as static
from paddle.static.quantization \
import QuantInt8MkldnnPass
from paddle.fluid.framework import IrGraph
from paddle.framework import core

graph = IrGraph(core.Graph(static.Program().desc), for_test=False)
place = static.CPUPlace()
mkldnn_pass = QuantInt8MkldnnPass(static.global_scope(),
place)
mkldnn_pass.apply(graph)

>>> # The original graph will be rewrite.
>>> import paddle
>>> from paddle import static
>>> from paddle.static.quantization import QuantInt8MkldnnPass
>>> from paddle.framework import IrGraph
>>> from paddle.framework import core

>>> graph = IrGraph(core.Graph(static.Program().desc), for_test=False)
>>> place = paddle.CPUPlace()
>>> mkldnn_pass = QuantInt8MkldnnPass(static.global_scope(), place)
>>> mkldnn_pass.apply(graph)
Comment on lines 46 to +58
Copy link
Contributor

Choose a reason for hiding this comment

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

.. code-block:: python 相对 Examples: 缩进一下吧~

Copy link
Member

Choose a reason for hiding this comment

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

@Candy2Tang 在其他 PR 里改一下吧

quantization 里这个问题非常多,相关目录得仔细看一下,甚至之后可以专门看一下这个目录下全部的示例代码的缩进

"""

self._scope = _scope
Expand Down