forked from PaddlePaddle/Paddle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* split layers,test=develop * split nn layers * remove nn header, test=develop
- Loading branch information
Showing
172 changed files
with
2,150 additions
and
1,395 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
#!/bin/bash | ||
|
||
mkdir -p layers | ||
for module in nn | ||
do | ||
python gen_doc.py --module_name layers.${module} --module_prefix layers --output layers/${module} --to_multiple_files True | ||
done | ||
|
||
for module in control_flow io nn ops tensor learning_rate_scheduler detection metric_op | ||
for module in control_flow io ops tensor learning_rate_scheduler detection metric_op | ||
do | ||
python gen_doc.py --module layers.${module} --module_prefix layers > layers/${module}.rst | ||
python gen_doc.py --module_name layers.${module} --module_prefix layers --output layers/${module}.rst | ||
done | ||
|
||
for module in data_feeder dataset clip metrics executor initializer io nets optimizer profiler regularizer transpiler recordio_writer backward average profiler unique_name | ||
do | ||
python gen_doc.py --module ${module} --module_prefix ${module} > ${module}.rst | ||
python gen_doc.py --module_name ${module} --module_prefix ${module} --output ${module}.rst | ||
done | ||
|
||
python gen_doc.py --module "" --module_prefix "" > fluid.rst | ||
python gen_doc.py --module_name "" --module_prefix "" --output fluid.rst | ||
|
||
python gen_module_index.py layers.nn nn | ||
python gen_module_index.py layers fluid.layers | ||
|
||
python gen_index.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import glob | ||
import sys | ||
import os | ||
|
||
def print_module_index(module, header): | ||
modules = module.split('.') | ||
if len(modules) > 1: | ||
os.chdir('/'.join(modules[0:-1])) | ||
pattern = modules[-1] + '/*.rst' | ||
stream = open(modules[-1] + '.rst', 'w') | ||
else: | ||
pattern = modules[0] + '/*.rst' | ||
stream = open(modules[0] + '.rst', 'w') | ||
|
||
stream.write('=' * len(header) + '\n') | ||
stream.write(header + '\n') | ||
stream.write('=' * len(header) + '\n') | ||
stream.write(''' | ||
.. toctree:: | ||
:maxdepth: 1 | ||
''') | ||
|
||
blank_num = 4 | ||
files = sorted(glob.glob(pattern), key=str.lower) | ||
|
||
for f in files: | ||
stream.write(' ' * blank_num) | ||
stream.write(f) | ||
stream.write('\n') | ||
|
||
stream.close() | ||
|
||
if __name__ == '__main__': | ||
if len(sys.argv) != 3: | ||
print('Usage: python gen_module_index.py [module_name] [header_name]') | ||
sys.exit(-1) | ||
|
||
print_module_index(sys.argv[1], sys.argv[2]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.