File tree Expand file tree Collapse file tree 6 files changed +199
-0
lines changed
backends/samsung/test/models Expand file tree Collapse file tree 6 files changed +199
-0
lines changed Original file line number Diff line number Diff line change 1+ # Copyright (c) Samsung Electronics Co. LTD
2+ # All rights reserved
3+ #
4+ # Licensed under the BSD License (the "License"); you may not use this file
5+ # except in compliance with the License. See the license file in the root
6+ # directory of this source tree for more details.
7+
8+
9+ import unittest
10+
11+ import torch
12+
13+ from executorch .backends .samsung .serialization .compile_options import (
14+ gen_samsung_backend_compile_spec ,
15+ )
16+ from executorch .backends .samsung .test .tester import SamsungTester
17+ from executorch .examples .models .edsr import EdsrModel
18+
19+
20+ class Test_Milestone_Edsr (unittest .TestCase ):
21+ def test_edsr_fp16 (self ):
22+ model = EdsrModel ().get_eager_model ()
23+ example_input = EdsrModel ().get_example_inputs ()
24+
25+ (
26+ SamsungTester (model ,
27+ example_input ,
28+ [gen_samsung_backend_compile_spec ("E9955" )],)
29+ .export ()
30+ .to_edge_transform_and_lower ()
31+ .to_executorch ()
32+ .run_method_and_compare_outputs (atol = 0.02 , rtol = 0.02 )
33+ )
Original file line number Diff line number Diff line change 1+ # Copyright (c) Samsung Electronics Co. LTD
2+ # All rights reserved
3+ #
4+ # Licensed under the BSD License (the "License"); you may not use this file
5+ # except in compliance with the License. See the license file in the root
6+ # directory of this source tree for more details.
7+
8+
9+ import unittest
10+
11+ import torch
12+
13+ from executorch .backends .samsung .serialization .compile_options import (
14+ gen_samsung_backend_compile_spec ,
15+ )
16+ from executorch .backends .samsung .test .tester import SamsungTester
17+ from executorch .examples .models .inception_v3 import InceptionV3Model
18+
19+
20+ class Test_Inception_V3 (unittest .TestCase ):
21+ def test_inception_v3_fp16 (self ):
22+ model = InceptionV3Model ().get_eager_model ()
23+ example_input = InceptionV3Model ().get_example_inputs ()
24+
25+ (
26+ SamsungTester (model ,
27+ example_input ,
28+ [gen_samsung_backend_compile_spec ("E9955" )],)
29+ .export ()
30+ .to_edge_transform_and_lower ()
31+ .to_executorch ()
32+ .run_method_and_compare_outputs (atol = 0.02 , rtol = 0.02 )
33+ )
Original file line number Diff line number Diff line change 1+ # Copyright (c) Samsung Electronics Co. LTD
2+ # All rights reserved
3+ #
4+ # Licensed under the BSD License (the "License"); you may not use this file
5+ # except in compliance with the License. See the license file in the root
6+ # directory of this source tree for more details.
7+
8+
9+ import unittest
10+
11+ import torch
12+
13+ from executorch .backends .samsung .serialization .compile_options import (
14+ gen_samsung_backend_compile_spec ,
15+ )
16+ from executorch .backends .samsung .test .tester import SamsungTester
17+ from executorch .examples .models .inception_v4 import InceptionV4Model
18+
19+
20+ class Test_Milestone_InceptionV4 (unittest .TestCase ):
21+ def test_inception_v4_fp16 (self ):
22+ model = InceptionV4Model ().get_eager_model ()
23+ example_input = InceptionV4Model ().get_example_inputs ()
24+
25+ (
26+ SamsungTester (model ,
27+ example_input ,
28+ [gen_samsung_backend_compile_spec ("E9955" )],)
29+ .export ()
30+ .to_edge_transform_and_lower ()
31+ .to_executorch ()
32+ .run_method_and_compare_outputs (atol = 0.02 , rtol = 0.02 )
33+ )
Original file line number Diff line number Diff line change 1+ # Copyright (c) Samsung Electronics Co. LTD
2+ # All rights reserved
3+ #
4+ # Licensed under the BSD License (the "License"); you may not use this file
5+ # except in compliance with the License. See the license file in the root
6+ # directory of this source tree for more details.
7+
8+
9+ import unittest
10+
11+ import torch
12+
13+ from executorch .backends .samsung .serialization .compile_options import (
14+ gen_samsung_backend_compile_spec ,
15+ )
16+ from executorch .backends .samsung .test .tester import SamsungTester
17+ from executorch .examples .models .mobilenet_v3 import MV3Model
18+
19+
20+ class Test_Milestone_MobilenetV3 (unittest .TestCase ):
21+ def test_mv3_fp16 (self ):
22+ model = MV3Model ().get_eager_model ()
23+ example_input = MV3Model ().get_example_inputs ()
24+
25+ (
26+ SamsungTester (model ,
27+ example_input ,
28+ [gen_samsung_backend_compile_spec ("E9955" )],)
29+ .export ()
30+ .to_edge_transform_and_lower ()
31+ .to_executorch ()
32+ .run_method_and_compare_outputs (atol = 0.06 , rtol = 0.06 )
33+ # TODO: theshold value should be updated after fixing accuracy issue
34+ )
Original file line number Diff line number Diff line change 1+ # Copyright (c) Samsung Electronics Co. LTD
2+ # All rights reserved
3+ #
4+ # Licensed under the BSD License (the "License"); you may not use this file
5+ # except in compliance with the License. See the license file in the root
6+ # directory of this source tree for more details.
7+
8+
9+ import unittest
10+
11+ import torch
12+
13+ from executorch .backends .samsung .serialization .compile_options import (
14+ gen_samsung_backend_compile_spec ,
15+ )
16+ from executorch .backends .samsung .test .tester import SamsungTester
17+ from executorch .examples .models .resnet import ResNet18Model
18+
19+
20+ class Test_Milestone_ResNet18 (unittest .TestCase ):
21+ def test_resnet18_fp16 (self ):
22+ model = ResNet18Model ().get_eager_model ()
23+ example_input = ResNet18Model ().get_example_inputs ()
24+
25+ (
26+ SamsungTester (model ,
27+ example_input ,
28+ [gen_samsung_backend_compile_spec ("E9955" )],)
29+ .export ()
30+ .to_edge_transform_and_lower ()
31+ .to_executorch ()
32+ .run_method_and_compare_outputs (atol = 0.02 , rtol = 0.02 )
33+ )
Original file line number Diff line number Diff line change 1+ # Copyright (c) Samsung Electronics Co. LTD
2+ # All rights reserved
3+ #
4+ # Licensed under the BSD License (the "License"); you may not use this file
5+ # except in compliance with the License. See the license file in the root
6+ # directory of this source tree for more details.
7+
8+
9+ import unittest
10+
11+ import torch
12+
13+ from executorch .backends .samsung .serialization .compile_options import (
14+ gen_samsung_backend_compile_spec ,
15+ )
16+ from executorch .backends .samsung .test .tester import SamsungTester
17+ from executorch .examples .models .resnet import ResNet50Model
18+
19+
20+ class Test_Milestone_ResNet50 (unittest .TestCase ):
21+ def test_resnet50_fp16 (self ):
22+ model = ResNet50Model ().get_eager_model ()
23+ example_input = ResNet50Model ().get_example_inputs ()
24+
25+ (
26+ SamsungTester (model ,
27+ example_input ,
28+ [gen_samsung_backend_compile_spec ("E9955" )],)
29+ .export ()
30+ .to_edge_transform_and_lower ()
31+ .to_executorch ()
32+ .run_method_and_compare_outputs (atol = 0.02 , rtol = 0.02 )
33+ )
You can’t perform that action at this time.
0 commit comments