未验证 提交 a9aca162 编写于 作者: C Candy2Tang 提交者: GitHub

[xdoctest][task 142] Reformat example code with google style in...

[xdoctest][task 142] Reformat example code with google style in quantization/quant_int8_mkldnn_pass.py (#56239)

* [xdoctest][task 142] test=docs_preview

* Update python/paddle/static/quantization/quant_int8_mkldnn_pass.py

* Update python/paddle/static/quantization/quant_int8_mkldnn_pass.py

---------
Co-authored-by: NNyakku Shigure <sigure.qaq@gmail.com>
上级 baf2ffaf
......@@ -44,18 +44,18 @@ class QuantInt8MkldnnPass:
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)
"""
self._scope = _scope
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册