Skip to content

Commit

Permalink
UFMT formatting on test/export (#123520)
Browse files Browse the repository at this point in the history
Partially addresses #123062

Ran lintrunner on:
test/export

Detail:
```Shell
$ lintrunner -a --take UFMT --all-files
ok No lint issues.
Successfully applied all patches.
```

Co-authored-by: Edward Z. Yang <ezyang@meta.com>
Pull Request resolved: #123520
Approved by: https://github.com/shink, https://github.com/ezyang
  • Loading branch information
FFFrog authored and pytorchmergebot committed Apr 9, 2024
1 parent c773913 commit ec7551d
Show file tree
Hide file tree
Showing 9 changed files with 591 additions and 346 deletions.
9 changes: 0 additions & 9 deletions .lintrunner.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1144,15 +1144,6 @@ exclude_patterns = [
'test/distributed/test_pg_wrapper.py',
'test/distributed/test_store.py',
'test/expect/__init__.py',
'test/export/test_db.py',
'test/export/test_export.py',
'test/export/test_funtionalized_assertions.py',
'test/export/test_pass_infra.py',
'test/export/test_passes.py',
'test/export/test_serialize.py',
'test/export/test_upgrade.py',
'test/export/test_verifier.py',
'test/export/test_unflatten.py',
'test/functorch/attn_ft.py',
'test/functorch/attn_positional.py',
'test/functorch/common_utils.py',
Expand Down
8 changes: 6 additions & 2 deletions test/export/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
from torch.export import export
from torch.testing._internal.common_utils import (
instantiate_parametrized_tests,
IS_WINDOWS,
parametrize,
run_tests,
TestCase,
IS_WINDOWS
)


@unittest.skipIf(IS_WINDOWS, "Windows not supported for this test")
@unittest.skipIf(not torchdynamo.is_dynamo_supported(), "dynamo doesn't support")
class ExampleTests(TestCase):
Expand Down Expand Up @@ -60,7 +61,9 @@ def test_exportdb_supported(self, name: str, case: ExportCase) -> None:
def test_exportdb_not_supported(self, name: str, case: ExportCase) -> None:
model = case.model
# pyre-ignore
with self.assertRaises((torchdynamo.exc.Unsupported, AssertionError, RuntimeError)):
with self.assertRaises(
(torchdynamo.exc.Unsupported, AssertionError, RuntimeError)
):
inputs = normalize_inputs(case.example_inputs)
exported_model = export(
model,
Expand All @@ -77,6 +80,7 @@ def test_exportdb_not_supported(self, name: str, case: ExportCase) -> None:
for rewrite_case in get_rewrite_cases(case)
]
if exportdb_not_supported_rewrite_cases:

@parametrize(
"name,rewrite_case",
exportdb_not_supported_rewrite_cases,
Expand Down

1 comment on commit ec7551d

@pytorchmergebot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted #123520 on behalf of https://github.com/PaliC due to lint is still broken (comment)

Please sign in to comment.