mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Revert "Add __main__ guards to jit tests (#154725)"
This reverts commit 1a55fb0ee87eaa8b376aaa82d95d213fe0fbe64b. Reverted https://github.com/pytorch/pytorch/pull/154725 on behalf of https://github.com/malfet due to This added 2nd copy of raise_on_run to common_utils.py which caused lint failures, see https://github.com/pytorch/pytorch/actions/runs/15445374980/job/43473457466 ([comment](https://github.com/pytorch/pytorch/pull/154725#issuecomment-2940503905))
This commit is contained in:
@ -871,11 +871,6 @@ def enable_profiling_mode_for_profiling_tests():
|
||||
torch._C._jit_set_profiling_executor(old_prof_exec_state)
|
||||
torch._C._get_graph_executor_optimize(old_prof_mode_state)
|
||||
|
||||
def raise_on_run_directly(file_to_call):
|
||||
raise RuntimeError("This test file is not meant to be run directly, "
|
||||
f"use:\n\n\tpython {file_to_call} TESTNAME\n\n"
|
||||
"instead.")
|
||||
|
||||
@contextmanager
|
||||
def enable_profiling_mode():
|
||||
old_prof_exec_state = torch._C._jit_set_profiling_executor(True)
|
||||
|
Reference in New Issue
Block a user