1
1
# Copyright (C) 2018-2024 Intel Corporation
2
2
# SPDX-License-Identifier: Apache-2.0
3
3
4
- import platform
5
- import sys
6
-
7
4
import numpy as np
5
+ import platform
8
6
import pytest
7
+ import sys
9
8
from common .tf_layer_test_class import CommonTFLayerTest
10
9
11
10
@@ -14,7 +13,7 @@ class TestUnaryOps(CommonTFLayerTest):
14
13
15
14
def _prepare_input (self , inputs_dict ):
16
15
non_negative = ['Sqrt' , 'Log' ]
17
- narrow_borders = ["Sinh" , "Cosh" , " Tanh" , "Exp" , "Selu " ]
16
+ narrow_borders = ["Tanh" ]
18
17
within_one = ['Asin' , 'Acos' , 'Atanh' ]
19
18
from_one = ['Acosh' ]
20
19
@@ -76,25 +75,14 @@ def create_net_with_unary_op(self, shape, ir_version, op_type, use_legacy_fronte
76
75
'Asin' : tf .math .asin ,
77
76
'Asinh' : tf .math .asinh ,
78
77
'Atan' : tf .math .atan ,
79
- 'Atanh' : tf .math .atanh ,
80
78
'BitwiseNot' : tf .bitwise .invert ,
81
79
'Ceiling' : tf .math .ceil ,
82
- 'Cos' : tf .math .cos ,
83
- 'Cosh' : tf .math .cosh ,
84
- 'Elu' : tf .nn .elu ,
85
- 'Erf' : tf .math .erf ,
86
- 'Exp' : tf .math .exp ,
87
80
'Floor' : tf .math .floor ,
88
81
'Log' : tf .math .log ,
89
82
'LogicalNot' : tf .math .logical_not ,
90
83
# 'Mish': tfa.activations.mish, # temporarily moved to `create_net_with_mish()`
91
84
'Negative' : tf .math .negative ,
92
- 'Selu' : tf .nn .selu ,
93
- 'Sigmoid' : tf .nn .sigmoid ,
94
85
'Sign' : tf .math .sign ,
95
- 'Sin' : tf .math .sin ,
96
- 'Sinh' : tf .math .sinh ,
97
- 'SoftPlus' : tf .nn .softplus ,
98
86
'Square' : tf .math .square ,
99
87
'Tan' : tf .math .tan ,
100
88
'Tanh' : tf .math .tanh ,
@@ -126,15 +114,8 @@ def create_net_with_unary_op(self, shape, ir_version, op_type, use_legacy_fronte
126
114
test_data_precommit = [dict (shape = [4 , 6 , 8 , 10 , 12 ])]
127
115
128
116
@pytest .mark .parametrize ("params" , test_data_precommit )
129
- @pytest .mark .parametrize ("op_type" , ['Elu' ,
130
- 'Sigmoid' ,
131
- 'Sin' ,
132
- 'Sinh' ,
133
- 'Cos' ,
134
- 'Cosh' ,
135
- 'Abs' ,
117
+ @pytest .mark .parametrize ("op_type" , ['Abs' ,
136
118
'Negative' ,
137
- 'Exp' ,
138
119
'Tan' ,
139
120
'Tanh' ,
140
121
'Floor' ,
@@ -145,15 +126,11 @@ def create_net_with_unary_op(self, shape, ir_version, op_type, use_legacy_fronte
145
126
'Atan' ,
146
127
'Log' ,
147
128
'Sign' ,
148
- 'SoftPlus' ,
149
- 'Atanh' ,
150
129
'Acosh' ,
151
130
'Asinh' ,
152
131
'LogicalNot' ,
153
132
'Square' ,
154
- 'Erf' ,
155
- 'BitwiseNot'
156
- ])
133
+ 'BitwiseNot' ])
157
134
@pytest .mark .nightly
158
135
def test_unary_op_precommit (self , params , ie_device , precision , ir_version , temp_dir , op_type ,
159
136
use_legacy_frontend ):
@@ -188,15 +165,8 @@ def test_unary_op_mish_precommit(self, params, ie_device, precision, ir_version,
188
165
dict (shape = [4 , 6 , 8 , 10 , 12 ])]
189
166
190
167
@pytest .mark .parametrize ("params" , test_data )
191
- @pytest .mark .parametrize ("op_type" , ['Elu' ,
192
- 'Sigmoid' ,
193
- 'Sin' ,
194
- 'Sinh' ,
195
- 'Cos' ,
196
- 'Cosh' ,
197
- 'Abs' ,
168
+ @pytest .mark .parametrize ("op_type" , ['Abs' ,
198
169
'Negative' ,
199
- 'Exp' ,
200
170
'Tan' ,
201
171
'Tanh' ,
202
172
'Floor' ,
@@ -206,17 +176,12 @@ def test_unary_op_mish_precommit(self, params, ie_device, precision, ir_version,
206
176
'Acos' ,
207
177
'Atan' ,
208
178
'Log' ,
209
- 'LogicalNot' ,
210
179
'Sign' ,
211
- 'SoftPlus' ,
212
- 'Atanh' ,
213
180
'Acosh' ,
214
181
'Asinh' ,
182
+ 'LogicalNot' ,
215
183
'Square' ,
216
- 'Erf' ,
217
- 'Selu' ,
218
- 'BitwiseNot'
219
- ])
184
+ 'BitwiseNot' ])
220
185
@pytest .mark .nightly
221
186
@pytest .mark .skipif (sys .platform == 'darwin' , reason = "Ticket - 122182" )
222
187
@pytest .mark .xfail (platform .machine () in ["aarch64" , "arm64" , "ARM64" ], reason = 'Ticket - 122716' )
0 commit comments