提交 b22ceba7 编写于 作者: M Megvii Engine Team

docs(imperative): fix code exmaple indent warnings

GitOrigin-RevId: aa533bf2964b4b40ea366329da66bd47a2ca2e52
上级 7ac693a8
...@@ -209,7 +209,11 @@ def main(): ...@@ -209,7 +209,11 @@ def main():
class to logs which can be read by python `tensorboard`. class to logs which can be read by python `tensorboard`.
Now `get_static_memory_alloc_info()` support this feature,it will dump a dir Now `get_static_memory_alloc_info()` support this feature,it will dump a dir
which can be convert by `graph_info_analyze.py`. which can be convert by `graph_info_analyze.py`.
Examples::
Examples:
.. code-block:: shell
graph_info_analyze.py -i <input_dir_name> -o <output_dir_name> graph_info_analyze.py -i <input_dir_name> -o <output_dir_name>
tensorboard --logdir <output_dir_name> tensorboard --logdir <output_dir_name>
""" """
......
...@@ -1777,7 +1777,7 @@ class ExprFilter(BaseFilter): ...@@ -1777,7 +1777,7 @@ class ExprFilter(BaseFilter):
class NodeFilter(BaseFilter): class NodeFilter(BaseFilter):
"""Filter on Node iterator. """Filter on Node iterator.
This class is an iterator of :class:`.Node` objects and multiple This class is an iterator of :class:`~.traced_module.Node` objects and multiple
filtering conditions and mappers can be chained. filtering conditions and mappers can be chained.
""" """
......
...@@ -141,13 +141,18 @@ class SummaryWriterExtend(SummaryWriter): ...@@ -141,13 +141,18 @@ class SummaryWriterExtend(SummaryWriter):
def add_text(self, tag, text_string_list, global_step=None, walltime=None): def add_text(self, tag, text_string_list, global_step=None, walltime=None):
"""Add text data to summary. """Add text data to summary.
Args: Args:
tag (string): Data identifier tag (string): Data identifier
text_string_list (string list): String to save text_string_list (string list): String to save
global_step (int): Global step value to record global_step (int): Global step value to record
walltime (float): Optional override default walltime (time.time()) walltime (float): Optional override default walltime (time.time())
seconds after epoch of event seconds after epoch of event
Examples::
Examples:
.. code-block:: python
# text can be divided into three levels by tag and global_step # text can be divided into three levels by tag and global_step
from writer import SummaryWriterExtend from writer import SummaryWriterExtend
writer = SummaryWriterExtend() writer = SummaryWriterExtend()
...@@ -171,8 +176,11 @@ class SummaryWriterExtend(SummaryWriter): ...@@ -171,8 +176,11 @@ class SummaryWriterExtend(SummaryWriter):
dtype=None, dtype=None,
attributes={}, attributes={},
): ):
"""Add node raw datas that can help build graph.After add all nodes, call """Add node raw datas that can help build graph.
add_graph_by_node_raw_list() to build graph and add graph data to summary.
After add all nodes, call ``add_graph_by_node_raw_list()`` to build
graph and add graph data to summary.
Args: Args:
name (string): opr name. name (string): opr name.
op (string): opr class name. op (string): opr class name.
...@@ -180,7 +188,11 @@ class SummaryWriterExtend(SummaryWriter): ...@@ -180,7 +188,11 @@ class SummaryWriterExtend(SummaryWriter):
outputshape (list): output shape. outputshape (list): output shape.
dtype (string): output data dtype. dtype (string): output data dtype.
attributes (dict): attributes info. attributes (dict): attributes info.
Examples::
Examples:
.. code-block:: python
from writer import SummaryWriterExtend from writer import SummaryWriterExtend
writer = SummaryWriterExtend() writer = SummaryWriterExtend()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册