提交 01dc38f2 编写于 作者: Y yuyang18

Add fluid.rst

上级 8169587b
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
=====
fluid
=====
Block
-----
.. autoclass:: paddle.fluid.fluid.Block
:members:
:noindex:
Variable
--------
.. autoclass:: paddle.fluid.fluid.Variable
:members:
:noindex:
Program
-------
.. autoclass:: paddle.fluid.fluid.Program
:members:
:noindex:
Operator
--------
.. autoclass:: paddle.fluid.fluid.Operator
:members:
:noindex:
default_startup_program
-----------------------
.. autofunction:: paddle.fluid.fluid.default_startup_program
:noindex:
default_main_program
--------------------
.. autofunction:: paddle.fluid.fluid.default_main_program
:noindex:
program_guard
-------------
.. autofunction:: paddle.fluid.fluid.program_guard
:noindex:
switch_startup_program
----------------------
.. autofunction:: paddle.fluid.fluid.switch_startup_program
:noindex:
switch_main_program
-------------------
.. autofunction:: paddle.fluid.fluid.switch_main_program
:noindex:
get_var
-------
.. autofunction:: paddle.fluid.fluid.get_var
:noindex:
Executor
--------
.. autoclass:: paddle.fluid.fluid.Executor
:members:
:noindex:
global_scope
------------
.. autofunction:: paddle.fluid.fluid.global_scope
:noindex:
scope_guard
-----------
.. autofunction:: paddle.fluid.fluid.scope_guard
:noindex:
switch_scope
------------
.. autofunction:: paddle.fluid.fluid.switch_scope
:noindex:
fetch_var
---------
.. autofunction:: paddle.fluid.fluid.fetch_var
:noindex:
Go
--
.. autoclass:: paddle.fluid.fluid.Go
:members:
:noindex:
make_channel
------------
.. autofunction:: paddle.fluid.fluid.make_channel
:noindex:
channel_send
------------
.. autofunction:: paddle.fluid.fluid.channel_send
:noindex:
channel_recv
------------
.. autofunction:: paddle.fluid.fluid.channel_recv
:noindex:
channel_close
-------------
.. autofunction:: paddle.fluid.fluid.channel_close
:noindex:
Select
------
.. autoclass:: paddle.fluid.fluid.Select
:members:
:noindex:
Trainer
-------
.. autoclass:: paddle.fluid.fluid.Trainer
:members:
:noindex:
BeginEpochEvent
---------------
.. autoclass:: paddle.fluid.fluid.BeginEpochEvent
:members:
:noindex:
EndEpochEvent
-------------
.. autoclass:: paddle.fluid.fluid.EndEpochEvent
:members:
:noindex:
BeginStepEvent
--------------
.. autoclass:: paddle.fluid.fluid.BeginStepEvent
:members:
:noindex:
EndStepEvent
------------
.. autoclass:: paddle.fluid.fluid.EndStepEvent
:members:
:noindex:
CheckpointConfig
----------------
.. autoclass:: paddle.fluid.fluid.CheckpointConfig
:members:
:noindex:
Inferencer
----------
.. autoclass:: paddle.fluid.fluid.Inferencer
:members:
:noindex:
memory_optimize
---------------
.. autofunction:: paddle.fluid.fluid.memory_optimize
:noindex:
release_memory
--------------
.. autofunction:: paddle.fluid.fluid.release_memory
:noindex:
ParallelExecutor
----------------
.. autoclass:: paddle.fluid.fluid.ParallelExecutor
:members:
:noindex:
ExecutionStrategy
-----------------
.. autoclass:: paddle.fluid.fluid.ExecutionStrategy
:members:
:noindex:
BuildStrategy
-------------
.. autoclass:: paddle.fluid.fluid.BuildStrategy
:members:
:noindex:
create_lod_tensor
-----------------
.. autofunction:: paddle.fluid.fluid.create_lod_tensor
:noindex:
create_random_int_lodtensor
---------------------------
.. autofunction:: paddle.fluid.fluid.create_random_int_lodtensor
:noindex:
LoDTensor
---------
.. autoclass:: paddle.fluid.fluid.LoDTensor
:members:
:noindex:
CPUPlace
--------
.. autoclass:: paddle.fluid.fluid.CPUPlace
:members:
:noindex:
CUDAPlace
---------
.. autoclass:: paddle.fluid.fluid.CUDAPlace
:members:
:noindex:
CUDAPinnedPlace
---------------
.. autoclass:: paddle.fluid.fluid.CUDAPinnedPlace
:members:
:noindex:
Tensor
------
.. autoclass:: paddle.fluid.fluid.Tensor
:members:
:noindex:
ParamAttr
---------
.. autoclass:: paddle.fluid.fluid.ParamAttr
:members:
:noindex:
WeightNormParamAttr
-------------------
.. autoclass:: paddle.fluid.fluid.WeightNormParamAttr
:members:
:noindex:
DataFeeder
----------
.. autoclass:: paddle.fluid.fluid.DataFeeder
:members:
:noindex:
../../paddle/doc/fluid/api/gen_doc.py
\ No newline at end of file
# 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.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=None, stream=sys.stdout):
if module_name == "":
module_name = None
self.stream = stream
if module_name is None:
self.module_name = "fluid"
else:
self.module_name = module_name
if module_name is None:
self.module = fluid
else:
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_(self.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, None)
if item is None:
return
if isinstance(item, types.TypeType):
self.print_class(name)
elif isinstance(item, types.FunctionType):
self.print_method(name)
else:
pass
def print_class(self, name):
self._print_header_(name, dot='-', is_title=False)
self.stream.write('''.. autoclass:: paddle.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.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()
......@@ -5,3 +5,5 @@ for module in data_feeder clip metrics executor initializer io nets optimizer pa
do
python gen_doc.py ${module} > ${module}.rst
done
python gen_doc.py "" > fluid.rst
......@@ -5,6 +5,7 @@ API Reference
.. toctree::
:maxdepth: 1
fluid.rst
layers.rst
data_feeder.rst
executor.rst
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册