pytorch/test/inductor/opinfo_harness.py
Jason Ansel c7c09722ad Move TorchDynamo into PyTorch core (#86461)
Context:
https://github.com/pytorch/torchdynamo/issues/1588

This PR moves [TorchDynamo](https://github.com/pytorch/torchdynamo) and TorchInductor into PyTorch core.
- `torchdynamo` becomes `torch._dynamo`
- `torchinductor` becomes `torch._inductor`

This PR was generated by running `copy_to_core.sh` in https://github.com/pytorch/torchdynamo/pull/1538

Pull Request resolved: https://github.com/pytorch/pytorch/pull/86461
Approved by: https://github.com/voznesenskym
2022-10-13 23:18:06 +00:00

26 lines
799 B
Python

import os
import subprocess
from torch.testing._internal.common_methods_invocations import op_db
if __name__ == "__main__":
i = 0
while i < len(op_db):
start = i
end = i + 20
os.environ["PYTORCH_TEST_RANGE_START"] = f"{start}"
os.environ["PYTORCH_TEST_RANGE_END"] = f"{end}"
popen = subprocess.Popen(
["pytest", "test/inductor/test_torchinductor_opinfo.py"],
stdout=subprocess.PIPE,
)
for line in popen.stdout:
print(line.decode(), end="")
popen.stdout.close()
return_code = popen.wait()
if return_code:
raise subprocess.CalledProcessError(
return_code, ["pytest", "test/inductor/test_torchinductor_opinfo.py"]
)
i = end + 1