Files
pytorch/test/inductor/minifier_smoke.py
Xuehai Pan 134bc4fc34 [BE][Easy][12/19] enforce style for empty lines in import segments in test/i*/ (#129763)
See https://github.com/pytorch/pytorch/pull/129751#issue-2380881501. Most changes are auto-generated by linter.

You can review these PRs via:

```bash
git diff --ignore-all-space --ignore-blank-lines HEAD~1
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/129763
Approved by: https://github.com/jansel
2024-07-18 07:49:19 +00:00

34 lines
763 B
Python

# Owner(s): ["module: inductor"]
#
# This smoketest is referenced in the internal-only minifier runbook
# https://docs.google.com/document/d/18L9e7bZSBpJ7gGbwlUV13LasmjiEX2lree2pl-SdbCU/edit
import os
os.environ["TORCHDYNAMO_REPRO_AFTER"] = "dynamo"
import torch
import torch._dynamo as torchdynamo
import torch._inductor.config
import torch._ops
torch._inductor.config.cpp.inject_relu_bug_TESTING_ONLY = "compile_error"
def func(x):
x = torch.sigmoid(x)
x = torch.mul(x, torch.ones(2))
x = torch.relu(x)
x = torch.add(x, torch.zeros(2))
x = torch.ops.aten.round(x)
return x
def run_internal_minifier():
torchdynamo.config.debug_dir_root = "."
f_opt = torch.compile(func)
f_opt(torch.ones(2))
run_internal_minifier()