in utils/convert_doc_to_notebooks.py [0:0]
def convert_all_tutorials(path_to_docs=None, path_to_dest=None):
""" Convert all tutorials into notebooks."""
path_to_docs = PATH_TO_DOCS if path_to_docs is None else path_to_docs
path_to_dest = PATH_TO_DEST if path_to_dest is None else path_to_dest
for folder in ["pytorch", "tensorflow"]:
os.makedirs(os.path.join(path_to_dest, folder), exist_ok=True)
for file in TUTORIAL_FILES:
notebook_name = os.path.splitext(file)[0] + ".ipynb"
doc_file = os.path.join(path_to_docs, file)
notebook_file = os.path.join(path_to_dest, notebook_name)
convert_rst_file_to_notebook(doc_file, notebook_file, origin_folder=path_to_docs, dest_folder=path_to_dest)
for folder, framework in zip(["pytorch", "tensorflow"], ["pt", "tf"]):
notebook_file = os.path.join(os.path.join(path_to_dest, folder), notebook_name)
convert_rst_file_to_notebook(doc_file, notebook_file, framework=framework, img_prefix="..")