Add support for Torch which is needed by NequIP

This commit is contained in:
Ole Schütt 2022-11-29 13:49:14 +01:00 committed by Ole Schütt
parent 72b5337cad
commit fcb0f647ee
12 changed files with 856 additions and 7 deletions

View file

@ -193,7 +193,11 @@ def process_file(fn: str, allow_modifications: bool) -> None:
run_remote_tool("clangformat", fn)
if re.match(r".*\.(cc|cpp|cxx|hcc|hpp|hxx)$", fn):
raise Exception(f"C++ is not supported.")
if fn.endswith("/torch_c_api.cpp"):
# Begrudgingly tolerated because PyTorch has no C API.
run_remote_tool("clangformat", fn)
else:
raise Exception(f"C++ is not supported.")
if re.match(r"(.*/PACKAGE)|(.*\.py)$", fn):
ast.parse(orig_content, filename=fn)