mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Stop parsing command line arguments every time common_utils is imported. (#156703)
Last PR in the series to re-submit https://github.com/pytorch/pytorch/pull/134592 as smaller PRs: https://github.com/pytorch/pytorch/pull/154612 https://github.com/pytorch/pytorch/pull/154628 https://github.com/pytorch/pytorch/pull/154715 https://github.com/pytorch/pytorch/pull/154716 https://github.com/pytorch/pytorch/pull/154725 https://github.com/pytorch/pytorch/pull/154728 Pull Request resolved: https://github.com/pytorch/pytorch/pull/156703 Approved by: https://github.com/clee2000
This commit is contained in:
committed by
PyTorch MergeBot
parent
c6329524d8
commit
ac7b4e7fe4
@ -5,12 +5,17 @@ from torch.cuda.amp import autocast
|
||||
from typing import Optional
|
||||
|
||||
import unittest
|
||||
from test_jit import JitTestCase
|
||||
from torch.testing._internal.common_cuda import TEST_CUDA
|
||||
from torch.testing._internal.common_utils import run_tests, skipIfTorchDynamo
|
||||
from torch.testing._internal.common_utils import parse_cmd_line_args, run_tests, skipIfTorchDynamo
|
||||
from torch.testing import FileCheck
|
||||
from jit.test_models import MnistNet
|
||||
|
||||
if __name__ == '__main__':
|
||||
# The value of GRAPH_EXECUTOR depends on command line arguments so make sure they're parsed
|
||||
# before instantiating tests.
|
||||
parse_cmd_line_args()
|
||||
|
||||
from test_jit import JitTestCase
|
||||
TEST_BFLOAT16 = TEST_CUDA and torch.cuda.is_bf16_supported()
|
||||
|
||||
@skipIfTorchDynamo("Not a TorchDynamo suitable test")
|
||||
|
Reference in New Issue
Block a user