未验证 提交 b76fdfc8 编写于 作者: T tianshuo78520a 提交者: GitHub

Add Paddle 2.0 API directory (#1968)

* add api_cn

* test=develop

* add paddle.tensor

* add
上级 346137d9
......@@ -13,9 +13,17 @@ fluid.dygraph
dygraph/Conv3D.rst
dygraph/Conv3DTranspose.rst
dygraph/CosineDecay.rst
dygraph/DataParallel.rst
dygraph/disable_dygraph.rst
dygraph/dygraph_to_static_code.rst
dygraph/dygraph_to_static_func.rst
dygraph/dygraph_to_static_output.rst
dygraph/dygraph_to_static_program.rst
dygraph/Embedding.rst
dygraph/enable_dygraph.rst
dygraph/enabled.rst
dygraph/ExponentialDecay.rst
dygraph/grad.rst
dygraph/GroupNorm.rst
dygraph/GRUUnit.rst
dygraph/guard.rst
......
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_dygraph_DataParallel:
DataParallel
------------
.. autoclass:: paddle.fluid.dygraph.DataParallel
:members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_dygraph_disable_dygraph:
disable_dygraph
---------------
.. autofunction:: paddle.fluid.dygraph.disable_dygraph
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_dygraph_dygraph_to_static_code:
dygraph_to_static_code
----------------------
.. autofunction:: paddle.fluid.dygraph.dygraph_to_static_code
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_dygraph_dygraph_to_static_func:
dygraph_to_static_func
----------------------
.. autofunction:: paddle.fluid.dygraph.dygraph_to_static_func
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_dygraph_dygraph_to_static_program:
dygraph_to_static_program
-------------------------
.. autofunction:: paddle.fluid.dygraph.dygraph_to_static_program
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_dygraph_enable_dygraph:
enable_dygraph
--------------
.. autofunction:: paddle.fluid.dygraph.enable_dygraph
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_dygraph_enabled:
enabled
-------
.. autofunction:: paddle.fluid.dygraph.enabled
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_dygraph_grad:
grad
----
.. autofunction:: paddle.fluid.dygraph.grad
:noindex:
......@@ -20,14 +20,15 @@ fluid
fluid/DataFeeder.rst
fluid/default_main_program.rst
fluid/default_startup_program.rst
fluid/disable_dygraph.rst
fluid/device_guard.rst
fluid/disable_dygraph.rst
fluid/DistributeTranspiler.rst
fluid/DistributeTranspilerConfig.rst
fluid/embedding.rst
fluid/enable_dygraph.rst
fluid/ExecutionStrategy.rst
fluid/Executor.rst
fluid/get_flags.rst
fluid/global_scope.rst
fluid/gradients.rst
fluid/in_dygraph_mode.rst
......@@ -47,6 +48,7 @@ fluid
fluid/require_version.rst
fluid/save.rst
fluid/scope_guard.rst
fluid/set_flags.rst
fluid/Tensor.rst
fluid/Variable.rst
fluid/WeightNormParamAttr.rst
......@@ -4,7 +4,7 @@
.. _api_fluid_device_guard:
device_guard
-----------------------
------------
.. autofunction:: paddle.fluid.device_guard
:noindex:
......
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_get_flags:
get_flags
---------
.. autofunction:: paddle.fluid.get_flags
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_set_flags:
set_flags
---------
.. autofunction:: paddle.fluid.set_flags
:noindex:
......@@ -20,6 +20,8 @@ import os
import contextlib
import paddle.fluid as fluid
import paddle.tensor as tensor
import paddle.nn as nn
#import paddle.framework as framework
def parse_arg():
parser = argparse.ArgumentParser()
......@@ -32,6 +34,8 @@ def parse_arg():
'--output', type=str, help='Output file or output directory for output rst')
parser.add_argument(
'--output_name', type=str, help='Output file or output directory for output rst')
parser.add_argument(
'--output_dir', type=str, help='Output file or output directory for output rst')
parser.add_argument(
'--to_multiple_files', type=bool, default=False, help='Whether to separate to multiple files')
......@@ -144,7 +148,7 @@ class DocGenerator(object):
self.stream.write(".. _api_{0}_{1}:\n\n".format("_".join(
self.module_prefix.split(".")), name))
def generate_doc(module_name, module_prefix, output, output_name, to_multiple_files):
def generate_doc(module_name, module_prefix, output, output_name, to_multiple_files, output_dir):
if module_name == "":
module_name = None
......@@ -172,6 +176,11 @@ def generate_doc(module_name, module_prefix, output, output_name, to_multiple_fi
gen.module_prefix = output_name + "." + module_prefix
dirname = output if to_multiple_files else os.path.dirname(output)
if output_dir != None:
dirname = output_dir + "/" + dirname
output = output_dir + "/" + output
if len(dirname) > 0 and (not os.path.exists(dirname) or not os.path.isdir(dirname)):
os.makedirs(dirname)
......@@ -203,7 +212,7 @@ def generate_doc(module_name, module_prefix, output, output_name, to_multiple_fi
def main():
args = parse_arg()
generate_doc(args.module_name, args.module_prefix, args.output, args.output_name, args.to_multiple_files)
generate_doc(args.module_name, args.module_prefix, args.output, args.output_name, args.to_multiple_files, args.output_dir)
if __name__ == '__main__':
......
......@@ -9,5 +9,21 @@ done
python gen_doc.py --module_name "" --module_prefix "" --output fluid --output_name fluid --to_multiple_files True
python gen_module_index.py fluid fluid
for module in math random
do
python gen_doc.py --module_name ${module} --module_prefix ${module} --output ${module} --output_name tensor --to_multiple_files True --output_dir tensor
python gen_module_index.py tensor.${module} ${module}
done
python gen_module_index.py tensor paddle.tensor
for module in loss
do
python gen_doc.py --module_name ${module} --module_prefix ${module} --output ${module} --output_name nn --to_multiple_files True --output_dir nn
python gen_module_index.py nn.${module} ${module}
done
python gen_module_index.py nn paddle.nn
python gen_index.py
......@@ -19,8 +19,10 @@ API Reference
layers.rst
metrics.rst
nets.rst
nn.rst
optimizer.rst
profiler.rst
regularizer.rst
tensor.rst
transpiler.rst
unique_name.rst
......@@ -11,4 +11,3 @@ ComposeNotAligned
:inherited-members:
:noindex:
This indicates an error state of compose API, which will raise when outputs of readers are not aligned.
......@@ -25,6 +25,7 @@ fluid.layers
layers/atan.rst
layers/auc.rst
layers/autoincreased_step_counter.rst
layers/BasicDecoder.rst
layers/batch_norm.rst
layers/beam_search.rst
layers/beam_search_decode.rst
......@@ -68,6 +69,7 @@ fluid.layers
layers/cumsum.rst
layers/data.rst
layers/data_norm.rst
layers/DecodeHelper.rst
layers/Decoder.rst
layers/deformable_conv.rst
layers/deformable_roi_pooling.rst
......@@ -104,6 +106,7 @@ fluid.layers
layers/eye.rst
layers/fc.rst
layers/fill_constant.rst
layers/fill_constant_batch_size_like.rst
layers/filter_by_instag.rst
layers/flatten.rst
layers/floor.rst
......@@ -112,6 +115,7 @@ fluid.layers
layers/gather_nd.rst
layers/gather_tree.rst
layers/gaussian_random.rst
layers/gaussian_random_batch_size_like.rst
layers/gelu.rst
layers/generate_mask_labels.rst
layers/generate_proposal_labels.rst
......@@ -119,6 +123,7 @@ fluid.layers
layers/get_tensor_from_selected_rows.rst
layers/greater_equal.rst
layers/greater_than.rst
layers/GreedyEmbeddingHelper.rst
layers/grid_sampler.rst
layers/group_norm.rst
layers/gru_unit.rst
......@@ -136,6 +141,7 @@ fluid.layers
layers/image_resize.rst
layers/image_resize_short.rst
layers/increment.rst
layers/inplace_abn.rst
layers/instance_norm.rst
layers/inverse_time_decay.rst
layers/iou_similarity.rst
......@@ -237,6 +243,7 @@ fluid.layers
layers/rpn_target_assign.rst
layers/rsqrt.rst
layers/sampled_softmax_with_cross_entropy.rst
layers/SampleEmbeddingHelper.rst
layers/sampling_id.rst
layers/scale.rst
layers/scatter.rst
......@@ -302,10 +309,12 @@ fluid.layers
layers/tensor_array_to_tensor.rst
layers/thresholded_relu.rst
layers/topk.rst
layers/TrainingHelper.rst
layers/transpose.rst
layers/unfold.rst
layers/Uniform.rst
layers/uniform_random.rst
layers/uniform_random_batch_size_like.rst
layers/unique.rst
layers/unique_with_counts.rst
layers/unsqueeze.rst
......
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_layers_BasicDecoder:
BasicDecoder
------------
.. autoclass:: paddle.fluid.layers.BasicDecoder
:members:
:inherited-members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_layers_DecodeHelper:
DecodeHelper
------------
.. autoclass:: paddle.fluid.layers.DecodeHelper
:members:
:inherited-members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_layers_GreedyEmbeddingHelper:
GreedyEmbeddingHelper
---------------------
.. autoclass:: paddle.fluid.layers.GreedyEmbeddingHelper
:members:
:inherited-members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_layers_SampleEmbeddingHelper:
SampleEmbeddingHelper
---------------------
.. autoclass:: paddle.fluid.layers.SampleEmbeddingHelper
:members:
:inherited-members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_layers_TrainingHelper:
TrainingHelper
--------------
.. autoclass:: paddle.fluid.layers.TrainingHelper
:members:
:inherited-members:
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_layers_fill_constant_batch_size_like:
fill_constant_batch_size_like
-----------------------------
.. autofunction:: paddle.fluid.layers.fill_constant_batch_size_like
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_layers_gaussian_random_batch_size_like:
gaussian_random_batch_size_like
-------------------------------
.. autofunction:: paddle.fluid.layers.gaussian_random_batch_size_like
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_layers_inplace_abn:
inplace_abn
-----------
.. autofunction:: paddle.fluid.layers.inplace_abn
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_fluid_layers_uniform_random_batch_size_like:
uniform_random_batch_size_like
------------------------------
.. autofunction:: paddle.fluid.layers.uniform_random_batch_size_like
:noindex:
=========
paddle.nn
=========
.. toctree::
:maxdepth: 1
nn/loss.rst
====
loss
====
.. toctree::
:maxdepth: 1
loss/L1Loss.rst
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_nn_loss_L1Loss:
L1Loss
------
.. autoclass:: paddle.nn.loss.L1Loss
:members:
:inherited-members:
:noindex:
......@@ -9,5 +9,6 @@ RecomputeOptimizer
.. autoclass:: paddle.fluid.optimizer.RecomputeOptimizer
:members:
:inherited-members:
:exclude-members: minimize, load, clear_gradients, current_step_lr, set_dict, state_dict
:exclude-members: apply_gradients, apply_optimize, backward, load
:noindex:
=============
paddle.tensor
=============
.. toctree::
:maxdepth: 1
tensor/math.rst
tensor/random.rst
====
math
====
.. toctree::
:maxdepth: 1
math/add.rst
math/atan.rst
math/div.rst
math/elementwise_sum.rst
math/mm.rst
math/mul.rst
math/pow.rst
math/sin.rst
math/sqrt.rst
math/sum.rst
math/tanh.rst
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_add:
add
---
.. autofunction:: paddle.tensor.math.add
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_atan:
atan
----
.. autofunction:: paddle.tensor.math.atan
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_div:
div
---
.. autofunction:: paddle.tensor.math.div
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_elementwise_sum:
elementwise_sum
---------------
.. autofunction:: paddle.tensor.math.elementwise_sum
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_mm:
mm
--
.. autofunction:: paddle.tensor.math.mm
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_mul:
mul
---
.. autofunction:: paddle.tensor.math.mul
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_pow:
pow
---
.. autofunction:: paddle.tensor.math.pow
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_sin:
sin
---
.. autofunction:: paddle.tensor.math.sin
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_sqrt:
sqrt
----
.. autofunction:: paddle.tensor.math.sqrt
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_sum:
sum
---
.. autofunction:: paddle.tensor.math.sum
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_math_tanh:
tanh
----
.. autofunction:: paddle.tensor.math.tanh
:noindex:
======
random
======
.. toctree::
:maxdepth: 1
random/randint.rst
random/randperm.rst
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_random_randint:
randint
-------
.. autofunction:: paddle.tensor.random.randint
:noindex:
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}`
!DO NOT EDIT THIS FILE MANUALLY!
.. _api_tensor_random_randperm:
randperm
--------
.. autofunction:: paddle.tensor.random.randperm
:noindex:
=======================
paddle.framework
=======================
.. toctree::
:maxdepth: 1
framework_cn/get_default_dtype.rst
framework_cn/manual_seed.rst
framework_cn/set_default_dtype.rst
......@@ -7,6 +7,7 @@ API Reference
../api_guides/index_cn.rst
fluid_cn.rst
api_tree_cn.rst
backward_cn.rst
clip_cn.rst
dataset_cn.rst
......
=======================
paddle.nn
=======================
.. toctree::
:maxdepth: 1
nn_cn/Conv1D.rst
nn_cn/Conv2D.rst
nn_cn/diag_embed.rst
nn_cn/interpolate.rst
nn_cn/Linear.rst
nn_cn/log_softmax.rst
nn_cn/ReLU.rst
nn_cn/Upsample.rst
nn_cn/activation_cn.rst
nn_cn/loss_cn.rst
=======================
activation
=======================
.. toctree::
:maxdepth: 1
activation_cn/Sigmoid.rst
=======================
loss
=======================
.. toctree::
:maxdepth: 1
loss_cn/BCELoss.rst
loss_cn/CrossEntropyLoss.rst
loss_cn/L1Loss.rst
loss_cn/MSELoss.rst
loss_cn/NLLLoss.rst
=======================
paddle.tensor
=======================
.. toctree::
:maxdepth: 1
tensor_cn/addcmul.rst
tensor_cn/addmm.rst
tensor_cn/add.rst
tensor_cn/allclose.rst
tensor_cn/arange.rst
tensor_cn/argmax.rst
tensor_cn/atan.rst
tensor_cn/bmm.rst
tensor_cn/cholesky.rst
tensor_cn/clamp.rst
tensor_cn/concat.rst
tensor_cn/cross.rst
tensor_cn/dist.rst
tensor_cn/div.rst
tensor_cn/dot.rst
tensor_cn/einsum.rst
tensor_cn/elementwise_equal.rst
tensor_cn/elementwise_sum.rst
tensor_cn/equal.rst
tensor_cn/erf.rst
tensor_cn/eye.rst
tensor_cn/flip.rst
tensor_cn/full_like.rst
tensor_cn/full.rst
tensor_cn/gather.rst
tensor_cn/index_select.rst
tensor_cn/inverse.rst
tensor_cn/isnan.rst
tensor_cn/linspace.rst
tensor_cn/log1p.rst
tensor_cn/logsumexp.rst
tensor_cn/math.rst
tensor_cn/matmul.rst
tensor_cn/max.rst
tensor_cn/meshgrid.rst
tensor_cn/min.rst
tensor_cn/mm.rst
tensor_cn/mul.rst
tensor_cn/nonzero.rst
tensor_cn/norm.rst
tensor_cn/ones_like.rst
tensor_cn/ones.rst
tensor_cn/pow.rst
tensor_cn/randint.rst
tensor_cn/randn.rst
tensor_cn/randperm.rst
tensor_cn/rand.rst
tensor_cn/roll.rst
tensor_cn/sin.rst
tensor_cn/sort.rst
tensor_cn/split.rst
tensor_cn/sqrt.rst
tensor_cn/squeeze.rst
tensor_cn/stack.rst
tensor_cn/std.rst
tensor_cn/sum.rst
tensor_cn/tanh.rst
tensor_cn/tensordot.rst
tensor_cn/transpose.rst
tensor_cn/tril.rst
tensor_cn/triu.rst
tensor_cn/t.rst
tensor_cn/unbind.rst
tensor_cn/unsqueeze.rst
tensor_cn/var.rst
tensor_cn/where.rst
tensor_cn/zeros_like.rst
tensor_cn/zeros.rst
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册