Esempio n. 1
0
File: conf.py Progetto: xvdp/DALI
git_sha = git_sha[:7] if len(git_sha) > 7 else git_sha

version = str(version_long + u"-" + git_sha)
# The full version, including alpha/beta/rc tags
release = str(version_long)

# generate table of supported operators and their devices
# mock torch required by supported_op_devices
with mock(["torch"]):
    sys.path.insert(0, os.path.abspath('./'))
    import operations_table
    operations_table.operations_table("fn_table")
    operations_table.fn_to_op_table("fn_to_op_table")

    import autodoc_submodules
    autodoc_submodules.op_autodoc("op_autodoc")
    autodoc_submodules.fn_autodoc("fn_autodoc")

# Uncomment to keep warnings in the output. Useful for verbose build and output debugging.
# keep_warnings = True

# hack: version is used for html creation, so put the version picker
# link here as well:
option_on = " selected"
option_off = ""
if "dev" in version_long:
    release_opt = option_off
    main_opt = option_on
    option_nr = 1
else:
    release_opt = option_on
Esempio n. 2
0
generated_path = Path("./operations")
generated_path.mkdir(exist_ok=True)

# generate table of supported operators and their devices
# mock torch required by supported_op_devices
with mock(["torch", "numba"]):
    sys.path.insert(0, os.path.abspath('./'))
    import operations_table
    operations_table.operations_table(generated_path / "fn_table")
    operations_table.fn_to_op_table(generated_path / "fn_to_op_table")

    import doc_index
    references = doc_index.document_examples('examples/index.py')

    import autodoc_submodules
    autodoc_submodules.op_autodoc(generated_path / "op_autodoc")
    autodoc_submodules.fn_autodoc(generated_path / "fn_autodoc",
                                  generated_path, references)

# Uncomment to keep warnings in the output. Useful for verbose build and output debugging.
# keep_warnings = True

# hack: version is used for html creation, so put the version picker
# link here as well:
option_on = " selected"
option_off = ""
if "dev" in version_long:
    release_opt = option_off
    main_opt = option_on
    option_nr = 1
else: