[Ez][BE]: Fix click ImportError in torch/csrc/jit (#153323)

Fixes unnecessary import for torch script. Unblocks #153020 as it appears to fix circular importer linter into importing every Python file under torch

Pull Request resolved: https://github.com/pytorch/pytorch/pull/153323
Approved by: https://github.com/ngimel, https://github.com/cyyever
This commit is contained in:
Aaron Gokaslan 2025-05-11 19:16:01 +00:00 committed by PyTorch MergeBot
parent c51bdf5acf
commit 0104ac0f6f

View File

@ -2,8 +2,6 @@
import subprocess
import click
def test(cmd, limit):
print(f"Testing PYTORCH_JIT_OPT_LIMIT=tensorexpr_fuser={limit} {cmd}")
@ -26,8 +24,6 @@ def test(cmd, limit):
return 0
@click.command()
@click.option("--cmd")
def bisect(cmd):
last_good = 0
first_bad = 10000
@ -69,4 +65,11 @@ def bisect(cmd):
if __name__ == "__main__":
bisect()
import click
@click.command()
@click.option("--cmd", required=True)
def cli(cmd):
bisect(cmd)
cli()