Merge pull request #8004 from reyoung/feature/simplize_doc
Add documentation generate script for fluidemailweixu-patch-1
commit
4326260844
@ -1,9 +1,14 @@
|
|||||||
|
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
|
||||||
|
!DO NOT EDIT THIS FILE MANUALLY!
|
||||||
|
|
||||||
===========
|
===========
|
||||||
DataFeeder
|
data_feeder
|
||||||
===========
|
===========
|
||||||
|
|
||||||
DataFeeder
|
DataFeeder
|
||||||
-----------
|
----------
|
||||||
.. automodule:: paddle.v2.fluid.data_feeder
|
|
||||||
:members: DataFeeder
|
.. autoclass:: paddle.v2.fluid.data_feeder.DataFeeder
|
||||||
|
:members:
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
@ -1,9 +1,21 @@
|
|||||||
===========
|
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
|
||||||
Evaluator
|
!DO NOT EDIT THIS FILE MANUALLY!
|
||||||
===========
|
|
||||||
|
=========
|
||||||
Evaluator
|
evaluator
|
||||||
-----------
|
=========
|
||||||
.. automodule:: paddle.v2.fluid.evaluator
|
|
||||||
:members: Evaluator
|
Accuracy
|
||||||
|
--------
|
||||||
|
|
||||||
|
.. autoclass:: paddle.v2.fluid.evaluator.Accuracy
|
||||||
|
:members:
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
ChunkEvaluator
|
||||||
|
--------------
|
||||||
|
|
||||||
|
.. autoclass:: paddle.v2.fluid.evaluator.ChunkEvaluator
|
||||||
|
:members:
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
@ -1,9 +1,32 @@
|
|||||||
===========
|
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
|
||||||
Executor
|
!DO NOT EDIT THIS FILE MANUALLY!
|
||||||
===========
|
|
||||||
|
========
|
||||||
|
executor
|
||||||
|
========
|
||||||
|
|
||||||
Executor
|
Executor
|
||||||
|
--------
|
||||||
|
|
||||||
|
.. autoclass:: paddle.v2.fluid.executor.Executor
|
||||||
|
:members:
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
global_scope
|
||||||
|
------------
|
||||||
|
|
||||||
|
.. autofunction:: paddle.v2.fluid.executor.global_scope
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
scope_guard
|
||||||
-----------
|
-----------
|
||||||
.. automodule:: paddle.v2.fluid.executor
|
|
||||||
:members: Executor
|
.. autofunction:: paddle.v2.fluid.executor.scope_guard
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
switch_scope
|
||||||
|
------------
|
||||||
|
|
||||||
|
.. autofunction:: paddle.v2.fluid.executor.switch_scope
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
@ -0,0 +1,109 @@
|
|||||||
|
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
import argparse
|
||||||
|
import sys
|
||||||
|
import types
|
||||||
|
|
||||||
|
import paddle.v2.fluid as fluid
|
||||||
|
|
||||||
|
|
||||||
|
def parse_arg():
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument('--submodules', nargs="*")
|
||||||
|
parser.add_argument(
|
||||||
|
'module', type=str, help='Generate the documentation of which module')
|
||||||
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
class DocGenerator(object):
|
||||||
|
def __init__(self, module_name, stream=sys.stdout):
|
||||||
|
self.stream = stream
|
||||||
|
self.module_name = module_name
|
||||||
|
if not hasattr(fluid, module_name):
|
||||||
|
raise ValueError("Cannot find fluid.{0}".format(module_name))
|
||||||
|
else:
|
||||||
|
self.module = getattr(fluid, module_name)
|
||||||
|
self.stream.write('''.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
|
||||||
|
!DO NOT EDIT THIS FILE MANUALLY!
|
||||||
|
|
||||||
|
''')
|
||||||
|
|
||||||
|
self._print_header_(module_name, dot='=', is_title=True)
|
||||||
|
|
||||||
|
def print_submodule(self, submodule_name):
|
||||||
|
submodule = getattr(self.module, submodule_name)
|
||||||
|
if submodule is None:
|
||||||
|
raise ValueError("Cannot find submodule {0}".format(submodule_name))
|
||||||
|
self.print_section(submodule_name)
|
||||||
|
|
||||||
|
for item in submodule.__all__:
|
||||||
|
self.print_item(item)
|
||||||
|
|
||||||
|
def print_current_module(self):
|
||||||
|
for item in self.module.__all__:
|
||||||
|
self.print_item(item)
|
||||||
|
|
||||||
|
def print_section(self, name):
|
||||||
|
self._print_header_(name, dot='=', is_title=False)
|
||||||
|
|
||||||
|
def print_item(self, name):
|
||||||
|
item = getattr(self.module, name)
|
||||||
|
if isinstance(item, types.TypeType):
|
||||||
|
self.print_class(name)
|
||||||
|
elif isinstance(item, types.FunctionType):
|
||||||
|
self.print_method(name)
|
||||||
|
else:
|
||||||
|
raise RuntimeError("Unsupported item {0}".format(name))
|
||||||
|
|
||||||
|
def print_class(self, name):
|
||||||
|
self._print_header_(name, dot='-', is_title=False)
|
||||||
|
self.stream.write('''.. autoclass:: paddle.v2.fluid.{0}.{1}
|
||||||
|
:members:
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
'''.format(self.module_name, name))
|
||||||
|
|
||||||
|
def print_method(self, name):
|
||||||
|
self._print_header_(name, dot='-', is_title=False)
|
||||||
|
self.stream.write('''.. autofunction:: paddle.v2.fluid.{0}.{1}
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
'''.format(self.module_name, name))
|
||||||
|
|
||||||
|
def _print_header_(self, name, dot, is_title):
|
||||||
|
dot_line = dot * len(name)
|
||||||
|
if is_title:
|
||||||
|
self.stream.write(dot_line)
|
||||||
|
self.stream.write('\n')
|
||||||
|
self.stream.write(name)
|
||||||
|
self.stream.write('\n')
|
||||||
|
self.stream.write(dot_line)
|
||||||
|
self.stream.write('\n')
|
||||||
|
self.stream.write('\n')
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
args = parse_arg()
|
||||||
|
gen = DocGenerator(args.module)
|
||||||
|
if args.submodules is None:
|
||||||
|
gen.print_current_module()
|
||||||
|
else:
|
||||||
|
for submodule_name in args.submodules:
|
||||||
|
gen.print_submodule(submodule_name)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
python gen_doc.py layers --submodules control_flow device io nn ops tensor > layers.rst
|
||||||
|
|
||||||
|
for module in io data_feeder evaluator executor initializer io nets optimizer param_attr profiler regularizer
|
||||||
|
do
|
||||||
|
python gen_doc.py ${module} > ${module}.rst
|
||||||
|
done
|
@ -1,50 +1,35 @@
|
|||||||
|
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
|
||||||
|
!DO NOT EDIT THIS FILE MANUALLY!
|
||||||
|
|
||||||
===========
|
===========
|
||||||
Initializer
|
initializer
|
||||||
===========
|
===========
|
||||||
|
|
||||||
|
Constant
|
||||||
|
--------
|
||||||
|
|
||||||
|
.. autoclass:: paddle.v2.fluid.initializer.Constant
|
||||||
Initializer
|
:members:
|
||||||
-----------
|
|
||||||
.. automodule:: paddle.v2.fluid.initializer
|
|
||||||
:members: Initializer
|
|
||||||
:noindex:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ConstantInitializer
|
|
||||||
-------------------
|
|
||||||
.. automodule:: paddle.v2.fluid.initializer
|
|
||||||
:members: ConstantInitializer
|
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
Uniform
|
||||||
|
-------
|
||||||
|
|
||||||
|
.. autoclass:: paddle.v2.fluid.initializer.Uniform
|
||||||
UniformInitializer
|
:members:
|
||||||
------------------
|
|
||||||
.. automodule:: paddle.v2.fluid.initializer
|
|
||||||
:members: UniformInitializer
|
|
||||||
:noindex:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NormalInitializer
|
|
||||||
-----------------
|
|
||||||
.. automodule:: paddle.v2.fluid.initializer
|
|
||||||
:members: NormalInitializer
|
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
Normal
|
||||||
|
------
|
||||||
|
|
||||||
XavierInitializer
|
.. autoclass:: paddle.v2.fluid.initializer.Normal
|
||||||
-----------------
|
:members:
|
||||||
.. automodule:: paddle.v2.fluid.initializer
|
|
||||||
:members: XavierInitializer
|
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
Xavier
|
||||||
|
------
|
||||||
|
|
||||||
MSRAInitializer
|
.. autoclass:: paddle.v2.fluid.initializer.Xavier
|
||||||
---------------
|
:members:
|
||||||
.. automodule:: paddle.v2.fluid.initializer
|
|
||||||
:members: MSRAInitializer
|
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
@ -1,10 +1,61 @@
|
|||||||
===========
|
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
|
||||||
IO
|
!DO NOT EDIT THIS FILE MANUALLY!
|
||||||
===========
|
|
||||||
|
|
||||||
|
==
|
||||||
|
io
|
||||||
|
==
|
||||||
|
|
||||||
|
save_vars
|
||||||
|
---------
|
||||||
|
|
||||||
is_parameter
|
.. autofunction:: paddle.v2.fluid.io.save_vars
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
save_params
|
||||||
-----------
|
-----------
|
||||||
.. autofunction:: paddle.v2.fluid.io.is_parameter
|
|
||||||
|
.. autofunction:: paddle.v2.fluid.io.save_params
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
save_persistables
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
.. autofunction:: paddle.v2.fluid.io.save_persistables
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
load_vars
|
||||||
|
---------
|
||||||
|
|
||||||
|
.. autofunction:: paddle.v2.fluid.io.load_vars
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
load_params
|
||||||
|
-----------
|
||||||
|
|
||||||
|
.. autofunction:: paddle.v2.fluid.io.load_params
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
load_persistables
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
.. autofunction:: paddle.v2.fluid.io.load_persistables
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
save_inference_model
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
.. autofunction:: paddle.v2.fluid.io.save_inference_model
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
load_inference_model
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
.. autofunction:: paddle.v2.fluid.io.load_inference_model
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
get_inference_program
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
.. autofunction:: paddle.v2.fluid.io.get_inference_program
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,33 +1,31 @@
|
|||||||
===========
|
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
|
||||||
Nets
|
!DO NOT EDIT THIS FILE MANUALLY!
|
||||||
===========
|
|
||||||
|
====
|
||||||
|
nets
|
||||||
|
====
|
||||||
|
|
||||||
simple_img_conv_pool
|
simple_img_conv_pool
|
||||||
--------------------
|
--------------------
|
||||||
.. autofunction:: paddle.v2.fluid.nets.simple_img_conv_pool
|
|
||||||
:noindex:
|
|
||||||
|
|
||||||
|
.. autofunction:: paddle.v2.fluid.nets.simple_img_conv_pool
|
||||||
img_conv_group
|
|
||||||
---------------
|
|
||||||
.. autofunction:: paddle.v2.fluid.nets.img_conv_group
|
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
|
||||||
sequence_conv_pool
|
sequence_conv_pool
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
.. autofunction:: paddle.v2.fluid.nets.sequence_conv_pool
|
.. autofunction:: paddle.v2.fluid.nets.sequence_conv_pool
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
|
||||||
glu
|
glu
|
||||||
---
|
---
|
||||||
|
|
||||||
.. autofunction:: paddle.v2.fluid.nets.glu
|
.. autofunction:: paddle.v2.fluid.nets.glu
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
|
||||||
scaled_dot_product_attention
|
scaled_dot_product_attention
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
.. autofunction:: paddle.v2.fluid.nets.scaled_dot_product_attention
|
.. autofunction:: paddle.v2.fluid.nets.scaled_dot_product_attention
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
@ -1,54 +1,49 @@
|
|||||||
===========
|
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
|
||||||
Optimizer
|
!DO NOT EDIT THIS FILE MANUALLY!
|
||||||
===========
|
|
||||||
|
|
||||||
Optimizer
|
|
||||||
-----------
|
|
||||||
.. automodule:: paddle.v2.fluid.optimizer
|
|
||||||
:members: Optimizer
|
|
||||||
:noindex:
|
|
||||||
|
|
||||||
|
=========
|
||||||
|
optimizer
|
||||||
|
=========
|
||||||
|
|
||||||
SGDOptimizer
|
SGD
|
||||||
-----------
|
---
|
||||||
.. automodule:: paddle.v2.fluid.optimizer
|
|
||||||
:members: SGDOptimizer
|
|
||||||
:noindex:
|
|
||||||
|
|
||||||
|
.. autoclass:: paddle.v2.fluid.optimizer.SGD
|
||||||
|
:members:
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
Momentum
|
||||||
|
--------
|
||||||
|
|
||||||
MomentumOptimizer
|
.. autoclass:: paddle.v2.fluid.optimizer.Momentum
|
||||||
-----------------
|
:members:
|
||||||
.. automodule:: paddle.v2.fluid.optimizer
|
|
||||||
:members: MomentumOptimizer
|
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
Adagrad
|
||||||
|
-------
|
||||||
|
|
||||||
|
.. autoclass:: paddle.v2.fluid.optimizer.Adagrad
|
||||||
AdagradOptimizer
|
:members:
|
||||||
----------------
|
|
||||||
.. automodule:: paddle.v2.fluid.optimizer
|
|
||||||
:members: AdagradOptimizer
|
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
Adam
|
||||||
|
----
|
||||||
|
|
||||||
AdamOptimizer
|
.. autoclass:: paddle.v2.fluid.optimizer.Adam
|
||||||
-------------
|
:members:
|
||||||
.. automodule:: paddle.v2.fluid.optimizer
|
|
||||||
:members: AdamOptimizer
|
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
Adamax
|
||||||
|
------
|
||||||
|
|
||||||
AdamaxOptimizer
|
.. autoclass:: paddle.v2.fluid.optimizer.Adamax
|
||||||
-----------
|
:members:
|
||||||
.. automodule:: paddle.v2.fluid.optimizer
|
|
||||||
:members: AdamaxOptimizer
|
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
DecayedAdagrad
|
||||||
|
--------------
|
||||||
|
|
||||||
DecayedAdagradOptimizer
|
.. autoclass:: paddle.v2.fluid.optimizer.DecayedAdagrad
|
||||||
-----------------------
|
:members:
|
||||||
.. automodule:: paddle.v2.fluid.optimizer
|
|
||||||
:members: DecayedAdagradOptimizer
|
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
@ -1,11 +1,21 @@
|
|||||||
===========
|
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
|
||||||
|
!DO NOT EDIT THIS FILE MANUALLY!
|
||||||
|
|
||||||
|
==========
|
||||||
|
param_attr
|
||||||
|
==========
|
||||||
|
|
||||||
ParamAttr
|
ParamAttr
|
||||||
===========
|
---------
|
||||||
|
|
||||||
|
.. autoclass:: paddle.v2.fluid.param_attr.ParamAttr
|
||||||
|
:members:
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
WeightNormParamAttr
|
||||||
|
-------------------
|
||||||
|
|
||||||
ParamAttr
|
.. autoclass:: paddle.v2.fluid.param_attr.WeightNormParamAttr
|
||||||
-----------
|
:members:
|
||||||
.. automodule:: paddle.v2.fluid.param_attr
|
|
||||||
:members: ParamAttr
|
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
@ -1,10 +1,25 @@
|
|||||||
===========
|
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
|
||||||
Profiler
|
!DO NOT EDIT THIS FILE MANUALLY!
|
||||||
===========
|
|
||||||
|
|
||||||
|
========
|
||||||
|
profiler
|
||||||
|
========
|
||||||
|
|
||||||
|
cuda_profiler
|
||||||
|
-------------
|
||||||
|
|
||||||
Profiler
|
|
||||||
-----------
|
|
||||||
.. autofunction:: paddle.v2.fluid.profiler.cuda_profiler
|
.. autofunction:: paddle.v2.fluid.profiler.cuda_profiler
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
reset_profiler
|
||||||
|
--------------
|
||||||
|
|
||||||
|
.. autofunction:: paddle.v2.fluid.profiler.reset_profiler
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
profiler
|
||||||
|
--------
|
||||||
|
|
||||||
|
.. autofunction:: paddle.v2.fluid.profiler.profiler
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
@ -1,25 +1,27 @@
|
|||||||
|
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
|
||||||
|
!DO NOT EDIT THIS FILE MANUALLY!
|
||||||
|
|
||||||
===========
|
===========
|
||||||
Regularizer
|
regularizer
|
||||||
===========
|
===========
|
||||||
|
|
||||||
WeightDecayRegularizer
|
append_regularization_ops
|
||||||
----------------------
|
-------------------------
|
||||||
.. automodule:: paddle.v2.fluid.regularizer
|
|
||||||
:members: WeightDecayRegularizer
|
|
||||||
:noindex:
|
|
||||||
|
|
||||||
|
|
||||||
L2DecayRegularizer
|
.. autofunction:: paddle.v2.fluid.regularizer.append_regularization_ops
|
||||||
------------------
|
|
||||||
.. automodule:: paddle.v2.fluid.regularizer
|
|
||||||
:members: L2DecayRegularizer
|
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
|
L1Decay
|
||||||
|
-------
|
||||||
|
|
||||||
|
.. autoclass:: paddle.v2.fluid.regularizer.L1Decay
|
||||||
|
:members:
|
||||||
|
:noindex:
|
||||||
|
|
||||||
L1DecayRegularizer
|
L2Decay
|
||||||
-------------------
|
-------
|
||||||
.. automodule:: paddle.v2.fluid.regularizer
|
|
||||||
:members: L1DecayRegularizer
|
|
||||||
|
|
||||||
|
.. autoclass:: paddle.v2.fluid.regularizer.L2Decay
|
||||||
|
:members:
|
||||||
|
:noindex:
|
||||||
|
|
||||||
|
Loading…
Reference in new issue