Skip to content

Commit 6d69738

Browse files
Apply lintrunner
1 parent 2439b8e commit 6d69738

File tree

6 files changed

+7
-24
lines changed

6 files changed

+7
-24
lines changed

examples/mediatek/aot_utils/oss_utils/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# LICENSE file in the root directory of this source tree.
66

77
import os
8-
from typing import Dict, Optional
8+
from typing import Optional
99

1010
import torch
1111
from executorch import exir

examples/mediatek/model_export_scripts/dcgan.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@
99
if os.getcwd() not in sys.path:
1010
sys.path.append(os.getcwd())
1111
import argparse
12-
import json
1312
import os
1413

1514
import dcgan_main
16-
import numpy as np
1715

1816
import torch
19-
from aot_utils.oss_utils.utils import build_executorch_binary, make_output_dir
17+
from aot_utils.oss_utils.utils import build_executorch_binary
2018
from executorch.backends.mediatek import Precision
2119

2220

examples/mediatek/model_export_scripts/emformer_rnnt.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,8 @@
99
if os.getcwd() not in sys.path:
1010
sys.path.append(os.getcwd())
1111
import argparse
12-
import json
1312
import os
1413

15-
import numpy as np
16-
17-
import torch
1814
from aot_utils.oss_utils.utils import build_executorch_binary
1915
from executorch.backends.mediatek import Precision
2016
from executorch.examples.models.emformer_rnnt import (

examples/mediatek/model_export_scripts/mobilebert.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@
99
if os.getcwd() not in sys.path:
1010
sys.path.append(os.getcwd())
1111
import argparse
12-
import json
1312
import os
1413

15-
import numpy as np
16-
17-
import torch
18-
from aot_utils.oss_utils.utils import build_executorch_binary, make_output_dir
14+
from aot_utils.oss_utils.utils import build_executorch_binary
1915
from executorch.backends.mediatek import Precision
2016
from executorch.examples.models.mobilebert import MobileBertModelExample
2117

examples/mediatek/model_export_scripts/vit_b_16.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@
99
if os.getcwd() not in sys.path:
1010
sys.path.append(os.getcwd())
1111
import argparse
12-
import json
13-
14-
import numpy as np
1512

1613
import torch
17-
from aot_utils.oss_utils.utils import build_executorch_binary, make_output_dir
14+
from aot_utils.oss_utils.utils import build_executorch_binary
1815
from executorch.backends.mediatek import Precision
1916
from executorch.examples.models.torchvision_vit import TorchVisionViTModel
2017

@@ -52,8 +49,8 @@ def forward(self, input1):
5249
instance = NhwcWrappedModel()
5350

5451
# if dropout.p = 0, change probability to 1e-6 to prevent -inf when quantize
55-
for name, module in instance.named_modules():
56-
if type(module) == torch.nn.Dropout:
52+
for _name, module in instance.named_modules():
53+
if isinstance(module, torch.nn.Dropout):
5754
if module.p == 0:
5855
module.p = 1e-6
5956

examples/mediatek/model_export_scripts/wav2letter.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,8 @@
99
if os.getcwd() not in sys.path:
1010
sys.path.append(os.getcwd())
1111
import argparse
12-
import json
1312

14-
import numpy as np
15-
16-
import torch
17-
from aot_utils.oss_utils.utils import build_executorch_binary, make_output_dir
13+
from aot_utils.oss_utils.utils import build_executorch_binary
1814
from executorch.backends.mediatek import Precision
1915
from executorch.examples.models.wav2letter import Wav2LetterModel
2016

0 commit comments

Comments
 (0)