1
1
# Copyright (C) 2018-2024 Intel Corporation
2
2
# SPDX-License-Identifier: Apache-2.0
3
3
4
- import platform
5
-
6
4
import numpy as np
5
+ import platform
7
6
import pytest
8
7
from common .tf_layer_test_class import CommonTFLayerTest
9
8
@@ -66,15 +65,12 @@ def create_add_placeholder_const_net(self, x_shape, y_shape, op_type):
66
65
'FloorMod' : tf .raw_ops .FloorMod ,
67
66
'FloorDiv' : tf .raw_ops .FloorDiv ,
68
67
'Xdivy' : tf .raw_ops .Xdivy ,
69
- 'BitwiseAnd' : tf .raw_ops .BitwiseAnd ,
70
- 'BitwiseOr' : tf .raw_ops .BitwiseOr ,
71
- 'BitwiseXor' : tf .raw_ops .BitwiseXor ,
72
68
}
73
69
74
70
input_type = np .float32
75
71
if op_type in ["LogicalAnd" , "LogicalOr" , "LogicalXor" ]:
76
72
input_type = bool
77
- elif op_type in ["BitwiseAnd" , "BitwiseOr" , "BitwiseXor" , 'Pow' ]:
73
+ elif op_type in ['Pow' ]:
78
74
input_type = np .int32
79
75
self .input_type = input_type
80
76
@@ -100,21 +96,21 @@ def create_add_placeholder_const_net(self, x_shape, y_shape, op_type):
100
96
@pytest .mark .parametrize ("op_type" ,
101
97
['Add' , 'AddV2' , 'Sub' , 'Mul' , 'Div' , 'RealDiv' , 'SquaredDifference' , 'Pow' ,
102
98
'Maximum' , 'Minimum' , 'Equal' , 'NotEqual' , 'Mod' , 'Greater' , 'GreaterEqual' , 'Less' ,
103
- 'LessEqual' , 'LogicalAnd' , 'LogicalOr' , 'FloorMod' , 'FloorDiv' ,
104
- 'Xdivy' , 'BitwiseAnd' , 'BitwiseOr' , 'BitwiseXor' , ])
99
+ 'LessEqual' , 'LogicalAnd' , 'LogicalOr' , 'FloorMod' , 'FloorDiv' , 'Xdivy' ])
105
100
@pytest .mark .nightly
106
101
@pytest .mark .precommit
107
102
@pytest .mark .xfail (condition = platform .system () == 'Darwin' and platform .machine () == 'arm64' ,
108
103
reason = 'Ticket - 122716' )
109
104
def test_binary_op (self , x_shape , y_shape , ie_device , precision , ir_version , temp_dir , op_type ,
110
105
use_legacy_frontend ):
111
- if use_legacy_frontend and op_type in ['BitwiseAnd' , 'BitwiseOr' , 'BitwiseXor' , ' Xdivy' ]:
112
- pytest .skip ("Bitwise and Xdivy ops are supported only by new TF FE." )
113
- if op_type in ['BitwiseAnd' , 'BitwiseOr' , 'BitwiseXor' , ' Pow' , 'Mod' ] and ie_device == 'GPU' :
114
- pytest .skip ("GPU does not support Bitwise ops. For Mod and Pow it has inference mismatch" )
106
+ if use_legacy_frontend and op_type in ['Xdivy' ]:
107
+ pytest .skip ("Xdivy op is supported only by new TF FE." )
108
+ if op_type in ['Pow' , 'Mod' ] and ie_device == 'GPU' :
109
+ pytest .skip ("For Mod and Pow GPU has inference mismatch" )
115
110
if op_type in ['Mod' , 'FloorDiv' , 'FloorMod' ]:
116
111
pytest .skip ("Inference mismatch for Mod and FloorDiv" )
117
- if ie_device == 'GPU' and precision == 'FP16' and op_type in ['Equal' , 'NotEqual' , 'Greater' , 'GreaterEqual' , 'Less' , 'LessEqual' ]:
118
- pytest .skip ("Accuracy mismatch on GPU" )
112
+ if ie_device == 'GPU' and precision == 'FP16' and op_type in ['Equal' , 'NotEqual' , 'Greater' , 'GreaterEqual' ,
113
+ 'Less' , 'LessEqual' ]:
114
+ pytest .skip ("Accuracy mismatch on GPU" )
119
115
self ._test (* self .create_add_placeholder_const_net (x_shape = x_shape , y_shape = y_shape , op_type = op_type ), ie_device ,
120
116
precision , ir_version , temp_dir = temp_dir , use_legacy_frontend = use_legacy_frontend )
0 commit comments