File tree Expand file tree Collapse file tree 6 files changed +7
-24
lines changed Expand file tree Collapse file tree 6 files changed +7
-24
lines changed Original file line number Diff line number Diff line change 5
5
# LICENSE file in the root directory of this source tree.
6
6
7
7
import os
8
- from typing import Dict , Optional
8
+ from typing import Optional
9
9
10
10
import torch
11
11
from executorch import exir
Original file line number Diff line number Diff line change 9
9
if os .getcwd () not in sys .path :
10
10
sys .path .append (os .getcwd ())
11
11
import argparse
12
- import json
13
12
import os
14
13
15
14
import dcgan_main
16
- import numpy as np
17
15
18
16
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
20
18
from executorch .backends .mediatek import Precision
21
19
22
20
Original file line number Diff line number Diff line change 9
9
if os .getcwd () not in sys .path :
10
10
sys .path .append (os .getcwd ())
11
11
import argparse
12
- import json
13
12
import os
14
13
15
- import numpy as np
16
-
17
- import torch
18
14
from aot_utils .oss_utils .utils import build_executorch_binary
19
15
from executorch .backends .mediatek import Precision
20
16
from executorch .examples .models .emformer_rnnt import (
Original file line number Diff line number Diff line change 9
9
if os .getcwd () not in sys .path :
10
10
sys .path .append (os .getcwd ())
11
11
import argparse
12
- import json
13
12
import os
14
13
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
19
15
from executorch .backends .mediatek import Precision
20
16
from executorch .examples .models .mobilebert import MobileBertModelExample
21
17
Original file line number Diff line number Diff line change 9
9
if os .getcwd () not in sys .path :
10
10
sys .path .append (os .getcwd ())
11
11
import argparse
12
- import json
13
-
14
- import numpy as np
15
12
16
13
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
18
15
from executorch .backends .mediatek import Precision
19
16
from executorch .examples .models .torchvision_vit import TorchVisionViTModel
20
17
@@ -52,8 +49,8 @@ def forward(self, input1):
52
49
instance = NhwcWrappedModel ()
53
50
54
51
# 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 ) :
57
54
if module .p == 0 :
58
55
module .p = 1e-6
59
56
Original file line number Diff line number Diff line change 9
9
if os .getcwd () not in sys .path :
10
10
sys .path .append (os .getcwd ())
11
11
import argparse
12
- import json
13
12
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
18
14
from executorch .backends .mediatek import Precision
19
15
from executorch .examples .models .wav2letter import Wav2LetterModel
20
16
You can’t perform that action at this time.
0 commit comments