mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Remove unused import in tests (#146266)
Fixes #ISSUE_NUMBER Pull Request resolved: https://github.com/pytorch/pytorch/pull/146266 Approved by: https://github.com/Skylion007
This commit is contained in:
parent
d80eef7c6d
commit
6ac8bc0cd2
|
|
@ -3,7 +3,6 @@
|
||||||
# flake8: noqa
|
# flake8: noqa
|
||||||
import copy
|
import copy
|
||||||
import dataclasses
|
import dataclasses
|
||||||
import io
|
|
||||||
import logging
|
import logging
|
||||||
import operator
|
import operator
|
||||||
import re
|
import re
|
||||||
|
|
@ -19,7 +18,7 @@ import torch._dynamo as torchdynamo
|
||||||
import torch.nn.functional as F
|
import torch.nn.functional as F
|
||||||
from functorch.experimental.control_flow import cond, map
|
from functorch.experimental.control_flow import cond, map
|
||||||
from torch import Tensor
|
from torch import Tensor
|
||||||
from torch._decomp import decomposition_table, get_decompositions
|
from torch._decomp import decomposition_table
|
||||||
from torch._dynamo.test_case import TestCase
|
from torch._dynamo.test_case import TestCase
|
||||||
from torch._dynamo.testing import normalize_gm
|
from torch._dynamo.testing import normalize_gm
|
||||||
from torch._export.pass_base import _ExportPassBaseDeprecatedDoNotUse
|
from torch._export.pass_base import _ExportPassBaseDeprecatedDoNotUse
|
||||||
|
|
@ -59,7 +58,6 @@ from torch.testing._internal.common_cuda import (
|
||||||
PLATFORM_SUPPORTS_FLASH_ATTENTION,
|
PLATFORM_SUPPORTS_FLASH_ATTENTION,
|
||||||
SM90OrLater,
|
SM90OrLater,
|
||||||
)
|
)
|
||||||
from torch.testing._internal.common_device_type import onlyCPU, onlyCUDA
|
|
||||||
from torch.testing._internal.common_utils import (
|
from torch.testing._internal.common_utils import (
|
||||||
find_library_location,
|
find_library_location,
|
||||||
IS_FBCODE,
|
IS_FBCODE,
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,7 @@ from torch.testing._internal.common_device_type import (
|
||||||
instantiate_device_type_tests,
|
instantiate_device_type_tests,
|
||||||
ops,
|
ops,
|
||||||
)
|
)
|
||||||
from torch.testing._internal.common_utils import (
|
from torch.testing._internal.common_utils import IS_WINDOWS, run_tests
|
||||||
IS_WINDOWS,
|
|
||||||
run_tests,
|
|
||||||
TestCase as TorchTestCase,
|
|
||||||
)
|
|
||||||
from torch.testing._internal.hop_db import (
|
from torch.testing._internal.hop_db import (
|
||||||
FIXME_hop_that_doesnt_have_opinfo_test_allowlist,
|
FIXME_hop_that_doesnt_have_opinfo_test_allowlist,
|
||||||
hop_db,
|
hop_db,
|
||||||
|
|
|
||||||
|
|
@ -1,51 +1,18 @@
|
||||||
# Owner(s): ["oncall: export"]
|
# Owner(s): ["oncall: export"]
|
||||||
# flake8: noqa
|
# flake8: noqa
|
||||||
import copy
|
|
||||||
import dataclasses
|
|
||||||
import unittest
|
import unittest
|
||||||
from contextlib import contextmanager
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from re import escape
|
|
||||||
from typing import Any, List
|
from typing import Any, List
|
||||||
|
|
||||||
from parameterized import parameterized_class
|
from parameterized import parameterized_class
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
import torch._dynamo as torchdynamo
|
import torch._dynamo as torchdynamo
|
||||||
from functorch.experimental.control_flow import cond, map
|
|
||||||
from torch import Tensor
|
from torch import Tensor
|
||||||
from torch._export.utils import (
|
from torch._export.utils import register_dataclass_as_pytree_node
|
||||||
get_buffer,
|
from torch.export import export
|
||||||
get_param,
|
|
||||||
is_buffer,
|
|
||||||
is_param,
|
|
||||||
register_dataclass_as_pytree_node,
|
|
||||||
)
|
|
||||||
from torch._higher_order_ops.torchbind import enable_torchbind_tracing
|
|
||||||
from torch.export import Constraint, Dim, export, FlatArgsAdapter, unflatten
|
|
||||||
from torch.export._swap import _swap_modules
|
from torch.export._swap import _swap_modules
|
||||||
from torch.export._trace import DEFAULT_EXPORT_DYNAMO_CONFIG
|
from torch.testing._internal.common_utils import IS_WINDOWS, run_tests, TestCase
|
||||||
from torch.fx.experimental.proxy_tensor import make_fx
|
|
||||||
from torch.testing import FileCheck
|
|
||||||
from torch.testing._internal.common_utils import (
|
|
||||||
find_library_location,
|
|
||||||
IS_FBCODE,
|
|
||||||
IS_MACOS,
|
|
||||||
IS_SANDCASTLE,
|
|
||||||
IS_WINDOWS,
|
|
||||||
run_tests,
|
|
||||||
skipIfTorchDynamo,
|
|
||||||
TestCase,
|
|
||||||
)
|
|
||||||
from torch.testing._internal.torchbind_impls import init_torchbind_implementations
|
|
||||||
from torch.utils._pytree import (
|
|
||||||
LeafSpec,
|
|
||||||
tree_flatten,
|
|
||||||
tree_unflatten,
|
|
||||||
TreeSpec,
|
|
||||||
treespec_dumps,
|
|
||||||
treespec_loads,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@unittest.skipIf(IS_WINDOWS, "Windows not supported for this test")
|
@unittest.skipIf(IS_WINDOWS, "Windows not supported for this test")
|
||||||
|
|
|
||||||
|
|
@ -1,49 +1,23 @@
|
||||||
# Owner(s): ["oncall: export"]
|
# Owner(s): ["oncall: export"]
|
||||||
# flake8: noqa
|
# flake8: noqa
|
||||||
import copy
|
import copy
|
||||||
import dataclasses
|
|
||||||
import unittest
|
import unittest
|
||||||
from contextlib import contextmanager
|
|
||||||
from dataclasses import dataclass
|
|
||||||
from re import escape
|
from re import escape
|
||||||
from typing import Any, List
|
from typing import Any, List
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
import torch._dynamo as torchdynamo
|
import torch._dynamo as torchdynamo
|
||||||
from functorch.experimental.control_flow import cond, map
|
|
||||||
from torch import Tensor
|
|
||||||
from torch._export.utils import (
|
|
||||||
get_buffer,
|
|
||||||
get_param,
|
|
||||||
is_buffer,
|
|
||||||
is_param,
|
|
||||||
register_dataclass_as_pytree_node,
|
|
||||||
)
|
|
||||||
from torch._higher_order_ops.torchbind import enable_torchbind_tracing
|
from torch._higher_order_ops.torchbind import enable_torchbind_tracing
|
||||||
from torch.export import Constraint, Dim, export, FlatArgsAdapter, unflatten
|
from torch.export import export, FlatArgsAdapter, unflatten
|
||||||
from torch.export._trace import DEFAULT_EXPORT_DYNAMO_CONFIG
|
|
||||||
from torch.export.unflatten import _disable_interpreter
|
from torch.export.unflatten import _disable_interpreter
|
||||||
from torch.fx.experimental.proxy_tensor import make_fx
|
|
||||||
from torch.testing import FileCheck
|
|
||||||
from torch.testing._internal.common_utils import (
|
from torch.testing._internal.common_utils import (
|
||||||
find_library_location,
|
|
||||||
IS_FBCODE,
|
|
||||||
IS_MACOS,
|
|
||||||
IS_SANDCASTLE,
|
|
||||||
IS_WINDOWS,
|
IS_WINDOWS,
|
||||||
run_tests,
|
run_tests,
|
||||||
skipIfTorchDynamo,
|
skipIfTorchDynamo,
|
||||||
TestCase,
|
TestCase,
|
||||||
)
|
)
|
||||||
from torch.testing._internal.torchbind_impls import init_torchbind_implementations
|
from torch.testing._internal.torchbind_impls import init_torchbind_implementations
|
||||||
from torch.utils._pytree import (
|
from torch.utils._pytree import TreeSpec
|
||||||
LeafSpec,
|
|
||||||
tree_flatten,
|
|
||||||
tree_unflatten,
|
|
||||||
TreeSpec,
|
|
||||||
treespec_dumps,
|
|
||||||
treespec_loads,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@unittest.skipIf(not torchdynamo.is_dynamo_supported(), "dynamo isn't support")
|
@unittest.skipIf(not torchdynamo.is_dynamo_supported(), "dynamo isn't support")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user