14
14
TosaPipelineMI ,
15
15
)
16
16
17
-
18
- input_t1 = Tuple [torch .Tensor ] # Input x
19
-
20
-
21
- class Ceil (torch .nn .Module ):
22
- def forward (self , x : torch .Tensor ):
23
- return torch .ceil (x )
24
-
25
- op_name = "ceil"
26
- aten_op = "torch.ops.aten.ceil.default"
27
- exir_op = "executorch_exir_dialects_edge__ops_aten_ceil_default"
17
+ input_t1 = Tuple [torch .Tensor ]
28
18
29
19
30
20
class Floor (torch .nn .Module ):
31
21
def forward (self , x : torch .Tensor ):
32
22
return torch .floor (x )
33
23
34
- op_name = "floor"
35
24
aten_op = "torch.ops.aten.floor.default"
36
25
exir_op = "executorch_exir_dialects_edge__ops_aten_floor_default"
37
26
@@ -43,77 +32,34 @@ def forward(self, x: torch.Tensor):
43
32
randn_neg = torch .randn (1 , 4 , 4 , 4 ) - 10
44
33
ramp = torch .arange (- 16 , 16 , 0.2 )
45
34
46
-
47
35
test_data = {
48
- "ceil_zeros" : lambda : (
49
- Ceil (),
50
- zeros ,
51
- ),
52
- "floor_zeros" : lambda : (
53
- Floor (),
54
- zeros ,
55
- ),
56
- "ceil_ones" : lambda : (
57
- Ceil (),
58
- ones ,
59
- ),
60
- "floor_ones" : lambda : (
61
- Floor (),
62
- ones ,
63
- ),
64
- "ceil_rand" : lambda : (
65
- Ceil (),
66
- rand ,
67
- ),
68
- "floor_rand" : lambda : (
69
- Floor (),
70
- rand ,
71
- ),
72
- "ceil_randn_pos" : lambda : (
73
- Ceil (),
74
- randn_pos ,
75
- ),
76
- "floor_randn_pos" : lambda : (
77
- Floor (),
78
- randn_pos ,
79
- ),
80
- "ceil_randn_neg" : lambda : (
81
- Ceil (),
82
- randn_neg ,
83
- ),
84
- "floor_randn_neg" : lambda : (
85
- Floor (),
86
- randn_neg ,
87
- ),
88
- "ceil_ramp" : lambda : (
89
- Ceil (),
90
- ramp ,
91
- ),
92
- "floor_ramp" : lambda : (
93
- Floor (),
94
- ramp ,
95
- ),
36
+ "floor_zeros" : lambda : (Floor (), zeros ),
37
+ "floor_ones" : lambda : (Floor (), ones ),
38
+ "floor_rand" : lambda : (Floor (), rand ),
39
+ "floor_randn_pos" : lambda : (Floor (), randn_pos ),
40
+ "floor_randn_neg" : lambda : (Floor (), randn_neg ),
41
+ "floor_ramp" : lambda : (Floor (), ramp ),
96
42
}
97
43
98
44
99
45
@common .parametrize ("test_data" , test_data )
100
- def test_unary_tosa_MI (test_data : input_t1 ):
101
- module , test_data = test_data ()
46
+ def test_floor_tosa_MI (test_data : input_t1 ):
47
+ module , data = test_data ()
102
48
pipeline = TosaPipelineMI [input_t1 ](
103
49
module ,
104
- (test_data ,),
50
+ (data ,),
105
51
module .aten_op ,
106
52
module .exir_op ,
107
53
)
108
54
pipeline .run ()
109
55
110
56
111
57
@common .parametrize ("test_data" , test_data )
112
- def test_unary_tosa_BI (test_data : input_t1 ):
113
- module , test_data = test_data ()
58
+ def test_floor_tosa_BI (test_data : input_t1 ):
59
+ module , data = test_data ()
114
60
pipeline = TosaPipelineBI [input_t1 ](
115
61
module ,
116
- (test_data ,),
62
+ (data ,),
117
63
module .aten_op ,
118
64
module .exir_op ,
119
65
atol = 0.06 ,
@@ -124,11 +70,11 @@ def test_unary_tosa_BI(test_data: input_t1):
124
70
125
71
@common .parametrize ("test_data" , test_data )
126
72
@common .XfailIfNoCorstone300
127
- def test_unary_u55_BI (test_data : input_t1 ):
128
- module , test_data = test_data ()
73
+ def test_floor_u55_BI (test_data : input_t1 ):
74
+ module , data = test_data ()
129
75
pipeline = EthosU55PipelineBI [input_t1 ](
130
76
module ,
131
- (test_data ,),
77
+ (data ,),
132
78
module .aten_op ,
133
79
module .exir_op ,
134
80
run_on_fvp = True ,
@@ -138,11 +84,11 @@ def test_unary_u55_BI(test_data: input_t1):
138
84
139
85
@common .parametrize ("test_data" , test_data )
140
86
@common .XfailIfNoCorstone320
141
- def test_unary_u85_BI (test_data : input_t1 ):
142
- module , test_data = test_data ()
87
+ def test_floor_u85_BI (test_data : input_t1 ):
88
+ module , data = test_data ()
143
89
pipeline = EthosU85PipelineBI [input_t1 ](
144
90
module ,
145
- (test_data ,),
91
+ (data ,),
146
92
module .aten_op ,
147
93
module .exir_op ,
148
94
run_on_fvp = True ,
0 commit comments