diff --git a/doc/fluid/api/gen_doc.py b/doc/fluid/api/gen_doc.py index 9d25572126088b0238e089485689659355394d54..65e92c908b471de7adc9e7281780beea0f792cde 100644 --- a/doc/fluid/api/gen_doc.py +++ b/doc/fluid/api/gen_doc.py @@ -83,7 +83,7 @@ class DocGenerator(object): def print_section(self, name): self._print_header_(name, dot='=', is_title=False) - def print_item(self, name): + def print_item(self, name, output_name): item = getattr(self.module, name, None) if isinstance(item, types.TypeType): self.print_class(name) @@ -91,7 +91,7 @@ class DocGenerator(object): self.print_method(name) else: self.stream.close() - path = os.getcwd()+"/fluid/"+name+".rst" + path = os.getcwd()+"/"+output_name+"/"+name+".rst" if name != "PipeReader": os.remove(path) @@ -208,7 +208,7 @@ def generate_doc(module_name, module_prefix, output, output_name, to_multiple_fi header_name = api with gen.guard(os.path.join(output, api + '.rst')): gen.print_header_reminder() - gen.print_item(api) + gen.print_item(api, output_name) def main(): diff --git a/doc/fluid/api/gen_doc.sh b/doc/fluid/api/gen_doc.sh index 322eb4f9d32a239de3be2653970a471342e744be..4f549e17ca72c74edf0c8dc70692651c2a414165 100644 --- a/doc/fluid/api/gen_doc.sh +++ b/doc/fluid/api/gen_doc.sh @@ -1,5 +1,6 @@ #!/bin/bash +# fluid for module in layers dataset clip metrics executor initializer io nets optimizer profiler regularizer transpiler backward profiler unique_name dygraph do python gen_doc.py --module_name ${module} --module_prefix ${module} --output ${module} --output_name fluid --to_multiple_files True @@ -9,6 +10,7 @@ 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 +# tensor for module in math random stat do python gen_doc.py --module_name ${module} --module_prefix ${module} --output ${module} --output_name tensor --to_multiple_files True --output_dir tensor @@ -17,14 +19,6 @@ 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 - for module in math manipulation do python gen_doc.py --module_name tensor.${module} --module_prefix tensor.${module} --output tensor/${module} --output_name complex --to_multiple_files True --output_dir complex @@ -34,5 +28,16 @@ done python gen_module_index.py complex.tensor tensor python gen_module_index.py complex paddle.complex +# nn +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_doc.py --module_name "" --module_prefix "" --output nn --output_name nn --to_multiple_files True +python gen_module_index.py nn paddle.nn + +# index.rst python gen_index.py