未验证 提交 77da237b 编写于 作者: 张春乔 提交者: GitHub

[xdoctest] reformat example code with google style in No. 212 (#56211)

上级 8bdb336d
...@@ -53,12 +53,12 @@ class Communicator: ...@@ -53,12 +53,12 @@ class Communicator:
Examples: Examples:
.. code-block:: python .. code-block:: python
import paddle >>> import paddle
prog = paddle.static.Program() >>> prog = paddle.static.Program()
comm = paddle.distributed.communicator.Communicator(prog) >>> comm = paddle.distributed.communicator.Communicator(prog)
comm.start() >>> comm.start()
comm.stop() >>> comm.stop()
""" """
# set all recv op to not_run mode # set all recv op to not_run mode
...@@ -136,12 +136,12 @@ class Communicator: ...@@ -136,12 +136,12 @@ class Communicator:
Examples: Examples:
.. code-block:: python .. code-block:: python
import paddle >>> import paddle
prog = paddle.static.Program() >>> prog = paddle.static.Program()
comm = paddle.distributed.communicator.Communicator(prog) >>> comm = paddle.distributed.communicator.Communicator(prog)
comm.start() >>> comm.start()
comm.stop() >>> comm.stop()
""" """
if self.communicator_ is None: if self.communicator_ is None:
print('you must call init_with_ctx first to init comm before start') print('you must call init_with_ctx first to init comm before start')
...@@ -158,12 +158,12 @@ class Communicator: ...@@ -158,12 +158,12 @@ class Communicator:
Examples: Examples:
.. code-block:: python .. code-block:: python
import paddle >>> import paddle
prog = paddle.static.Program() >>> prog = paddle.static.Program()
comm = paddle.distributed.communicator.Communicator(prog) >>> comm = paddle.distributed.communicator.Communicator(prog)
comm.start() >>> comm.start()
comm.stop() >>> comm.stop()
""" """
if self.communicator_ is None: if self.communicator_ is None:
print('you must call init_with_ctx first to init comm before stop') print('you must call init_with_ctx first to init comm before stop')
...@@ -180,11 +180,11 @@ class Communicator: ...@@ -180,11 +180,11 @@ class Communicator:
Examples: Examples:
.. code-block:: python .. code-block:: python
import paddle >>> import paddle
prog = paddle.static.Program() >>> prog = paddle.static.Program()
comm = paddle.distributed.communicator.Communicator(prog) >>> comm = paddle.distributed.communicator.Communicator(prog)
comm.is_running() >>> comm.is_running()
""" """
if self.communicator_ is None: if self.communicator_ is None:
print('you must call init_with_ctx first to init comm before stop') print('you must call init_with_ctx first to init comm before stop')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册