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 55# LICENSE file in the root directory of this source tree.
66
77import os
8- from typing import Dict , Optional
8+ from typing import Optional
99
1010import torch
1111from executorch import exir
Original file line number Diff line number Diff line change 99if os .getcwd () not in sys .path :
1010 sys .path .append (os .getcwd ())
1111import argparse
12- import json
1312import os
1413
1514import dcgan_main
16- import numpy as np
1715
1816import 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
2018from executorch .backends .mediatek import Precision
2119
2220
Original file line number Diff line number Diff line change 99if os .getcwd () not in sys .path :
1010 sys .path .append (os .getcwd ())
1111import argparse
12- import json
1312import os
1413
15- import numpy as np
16-
17- import torch
1814from aot_utils .oss_utils .utils import build_executorch_binary
1915from executorch .backends .mediatek import Precision
2016from executorch .examples .models .emformer_rnnt import (
Original file line number Diff line number Diff line change 99if os .getcwd () not in sys .path :
1010 sys .path .append (os .getcwd ())
1111import argparse
12- import json
1312import 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
1915from executorch .backends .mediatek import Precision
2016from executorch .examples .models .mobilebert import MobileBertModelExample
2117
Original file line number Diff line number Diff line change 99if os .getcwd () not in sys .path :
1010 sys .path .append (os .getcwd ())
1111import argparse
12- import json
13-
14- import numpy as np
1512
1613import 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
1815from executorch .backends .mediatek import Precision
1916from 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
Original file line number Diff line number Diff line change 99if os .getcwd () not in sys .path :
1010 sys .path .append (os .getcwd ())
1111import 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
1814from executorch .backends .mediatek import Precision
1915from executorch .examples .models .wav2letter import Wav2LetterModel
2016
You can’t perform that action at this time.
0 commit comments