[Tests] Clean-up TensorFlow 1 Layer tests (#13320)

Remove useless and confusing comments

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
This commit is contained in:
Roman Kazantsev 2022-10-04 09:26:53 +03:00 committed by GitHub
parent 67ad21da52
commit f32530f0d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 10 additions and 252 deletions

View File

@ -13,16 +13,12 @@ class TestAdd(CommonTFLayerTest):
"""
Tensorflow net IR net
Placeholder->Add => Placeholder->Eltwise or Power or ScaleShift
Placeholder->Add => Placeholder->Add
/ /
Const-------/ Const-------/
"""
#
# Create Tensorflow model
#
import tensorflow as tf
tf.compat.v1.reset_default_graph()
@ -61,9 +57,7 @@ class TestAdd(CommonTFLayerTest):
# TODO: implement tests for 2 Consts + Add
test_data_1D = [
# Power
dict(x_shape=[1], y_shape=[1]),
# Eltwise
pytest.param(dict(x_shape=[3], y_shape=[3]), marks=pytest.mark.xfail(reason="*-19180"))
]
@ -77,14 +71,10 @@ class TestAdd(CommonTFLayerTest):
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_2D = [
# Power
dict(x_shape=[1, 1], y_shape=[1, 1]),
# ScaleShift
dict(x_shape=[1, 3], y_shape=[1, 3]),
# Eltwise
pytest.param(dict(x_shape=[3, 1], y_shape=[3, 1]),
marks=pytest.mark.xfail(reason="*-19180")),
# Eltwise
dict(x_shape=[2, 3], y_shape=[2, 3])
]
@ -98,16 +88,12 @@ class TestAdd(CommonTFLayerTest):
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_3D = [
# Power
dict(x_shape=[1, 1, 1], y_shape=[1, 1, 1]),
# ScaleShift
pytest.param(dict(x_shape=[1, 3, 1], y_shape=[1, 3, 1]),
marks=pytest.mark.xfail(reason="*-19053")),
# Eltwise
pytest.param(dict(x_shape=[1, 1, 3], y_shape=[1, 1, 3]),
marks=[pytest.mark.xfail(reason="*-19053"),
pytest.mark.xfail(reason="*-18830")]),
# Eltwise
pytest.param(dict(x_shape=[1, 3, 224], y_shape=[1, 3, 224]),
marks=pytest.mark.xfail(reason="*-19053"))
]
@ -122,14 +108,10 @@ class TestAdd(CommonTFLayerTest):
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_4D = [
# Power
dict(x_shape=[1, 1, 1, 1], y_shape=[1, 1, 1, 1]),
# ScaleShift
dict(x_shape=[1, 3, 1, 1], y_shape=[1, 3, 1, 1]),
# Eltwise
pytest.param(dict(x_shape=[1, 1, 1, 3], y_shape=[1, 1, 1, 3]),
marks=pytest.mark.xfail(reason="*-19180")),
# Eltwise
dict(x_shape=[1, 3, 222, 224], y_shape=[1, 3, 222, 224])
]
@ -144,14 +126,10 @@ class TestAdd(CommonTFLayerTest):
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_5D = [
# Power
dict(x_shape=[1, 1, 1, 1, 1], y_shape=[1, 1, 1, 1, 1]),
# ScaleShift
dict(x_shape=[1, 3, 1, 1, 1], y_shape=[1, 3, 1, 1, 1]),
# Eltwise
pytest.param(dict(x_shape=[1, 1, 1, 1, 3], y_shape=[1, 1, 1, 1, 3]),
marks=pytest.mark.xfail(reason="*-19180")),
# Eltwise
dict(x_shape=[1, 3, 50, 100, 224], y_shape=[1, 3, 50, 100, 224])
]
@ -172,7 +150,6 @@ class TestAdd(CommonTFLayerTest):
###############################################################################################
test_data_broadcast_1D = [
# Power
dict(x_shape=[3], y_shape=[1])
]
@ -186,15 +163,10 @@ class TestAdd(CommonTFLayerTest):
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_broadcast_2D = [
# Power
dict(x_shape=[1, 1], y_shape=[1]),
# Power
dict(x_shape=[1, 3], y_shape=[1]),
# ScaleShift
dict(x_shape=[1, 3], y_shape=[3]),
# Eltwise
dict(x_shape=[3, 1], y_shape=[3]),
# Eltwise
pytest.param(dict(x_shape=[3, 1], y_shape=[1, 3, 1, 1]),
marks=pytest.mark.xfail(reason="*-19051"))
]
@ -209,24 +181,17 @@ class TestAdd(CommonTFLayerTest):
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_broadcast_3D = [
# Power
dict(x_shape=[1, 1, 1], y_shape=[1]),
# Power
pytest.param(dict(x_shape=[1, 3, 1], y_shape=[1]),
marks=pytest.mark.xfail(reason="*-19053")),
# ScaleShift
pytest.param(dict(x_shape=[1, 3, 1], y_shape=[3]),
marks=pytest.mark.xfail(reason="*-19053")),
# Eltwise
pytest.param(dict(x_shape=[1, 3, 1], y_shape=[3, 1]),
marks=pytest.mark.xfail(reason="*-19053")),
# Eltwise
pytest.param(dict(x_shape=[1, 1, 1], y_shape=[3, 1]),
marks=pytest.mark.xfail(reason="*-19053")),
# Eltwise
pytest.param(dict(x_shape=[3, 1, 224], y_shape=[1, 3, 224]),
marks=pytest.mark.xfail(reason="*-19053")),
# Eltwise
pytest.param(dict(x_shape=[2, 3, 1], y_shape=[1, 3, 2]),
marks=pytest.mark.xfail(reason="*-19053")),
]
@ -241,25 +206,15 @@ class TestAdd(CommonTFLayerTest):
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_broadcast_4D = [
# Power
dict(x_shape=[1, 1, 1, 1], y_shape=[1]),
# Power
dict(x_shape=[1, 3, 1, 1], y_shape=[1]),
# ScaleShift
dict(x_shape=[1, 3, 1, 1], y_shape=[3]),
# ScaleShift
dict(x_shape=[1, 3, 100, 224], y_shape=[3]),
# Eltwise
dict(x_shape=[1, 1, 1, 3], y_shape=[3]),
# Eltwise
pytest.param(dict(x_shape=[1, 3, 1, 1], y_shape=[3, 1]), marks=pytest.mark.precommit_tf_fe),
# Eltwise
dict(x_shape=[1, 2, 1, 3], y_shape=[3, 1, 2]),
# Eltwise
dict(x_shape=[1, 2, 1, 3], y_shape=[1, 3, 2]),
# Eltwise
dict(x_shape=[1, 3, 100, 224], y_shape=[1, 1, 1, 224]),
# Eltwise
dict(x_shape=[2, 3, 1, 2], y_shape=[1, 3, 2, 1])
]
@ -274,23 +229,14 @@ class TestAdd(CommonTFLayerTest):
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_broadcast_5D = [
# Power
dict(x_shape=[1, 1, 1, 1, 1], y_shape=[1]),
# Power
dict(x_shape=[1, 3, 1, 1, 1], y_shape=[1, 1]),
# ScaleShift
dict(x_shape=[1, 3, 1, 1, 1], y_shape=[3]),
# Eltwise
dict(x_shape=[1, 1, 1, 1, 3], y_shape=[3]),
# Eltwise
dict(x_shape=[1, 3, 1, 1, 1], y_shape=[3, 1]),
# Eltwise
dict(x_shape=[1, 2, 1, 1, 3], y_shape=[1, 3, 2]),
# Eltwise
dict(x_shape=[1, 3, 5, 1, 2], y_shape=[5, 3, 2, 1]),
# Eltwise
dict(x_shape=[1, 3, 50, 100, 224], y_shape=[1, 1, 1, 1, 224]),
# Eltwise
dict(x_shape=[2, 3, 1, 2, 1], y_shape=[1, 3, 2, 1, 1])
]

View File

@ -10,16 +10,12 @@ class TestBatchToSpace(CommonTFLayerTest):
def create_batch_to_space_net(self, in_shape, crops_value, block_shape_value, out_shape,
ir_version, use_new_frontend):
"""
Tensorflow net IR net
Tensorflow net IR net
Input->BatchToSpace => Input->BatchToSpace
"""
#
# Create Tensorflow model
#
import tensorflow as tf
tf.compat.v1.reset_default_graph()

View File

@ -12,16 +12,12 @@ class TestBiasAdd(CommonTFLayerTest):
"""
Tensorflow net IR net
Placeholder->BiasAdd => Placeholder->Power or ScaleShift
Placeholder->BiasAdd => Placeholder->Add
/ /
Const-------/ Const-------/
"""
#
# Create Tensorflow model
#
import tensorflow as tf
import numpy as np

View File

@ -39,9 +39,9 @@ class TestBinaryOps(CommonTFLayerTest):
def create_add_placeholder_const_net(self, x_shape, y_shape, ir_version, op_type,
use_new_frontend):
"""
Tensorflow net IR net
Tensorflow net IR net
Placeholder->BinaryOp => Placeholder->Eltwise or Power or ScaleShift
Placeholder->BinaryOp => Placeholder->BinaryOp
/ /
Const-------/ Const-------/
@ -49,9 +49,6 @@ class TestBinaryOps(CommonTFLayerTest):
self.current_op_type = op_type
#
# Create Tensorflow model
#
import tensorflow as tf
op_type_to_tf = {

View File

@ -21,12 +21,12 @@ class TestBucketize(CommonTFLayerTest):
{attrs: boundaries}
"""
# create Tensorflow model
tf.compat.v1.reset_default_graph()
with tf.compat.v1.Session() as sess:
x = tf.compat.v1.placeholder(input_type, input_shape, 'Input')
constant_value = np.arange(-boundaries_size * 5, boundaries_size * 5, 10,
dtype=np.float32)
# TODO: Bucketize is not tested here. Need to re-write the test
tf.compat.v1.global_variables_initializer()
tf_net = sess.graph_def

View File

@ -16,10 +16,6 @@ class TestConcat(CommonTFLayerTest):
"""
#
# Create Tensorflow model
#
import tensorflow as tf
tf.compat.v1.reset_default_graph()

View File

@ -16,10 +16,6 @@ class TestEltwise(CommonTFLayerTest):
"""
#
# Create Tensorflow model
#
import tensorflow as tf
tf.compat.v1.reset_default_graph()

View File

@ -13,10 +13,6 @@ class TestTFGRUBlockCell(CommonTFLayerTest):
return inputs_dict
def create_tf_gru_block_cell(self, batch_size, input_size, hidden_size):
#
# Create Tensorflow model
#
import tensorflow as tf
tf.compat.v1.reset_default_graph()

View File

@ -18,10 +18,6 @@ class TestIdentity(CommonTFLayerTest):
"""
#
# Create Tensorflow model
#
import tensorflow as tf
tf.compat.v1.reset_default_graph()

View File

@ -21,10 +21,6 @@ class TestLogSoftmax(CommonTFLayerTest):
"""
#
# Create Tensorflow model
#
import tensorflow as tf
tf.compat.v1.reset_default_graph()

View File

@ -13,16 +13,12 @@ class TestMul(CommonTFLayerTest):
"""
Tensorflow net IR net
Placeholder->Mul => Placeholder->Eltwise or Power or ScaleShift
Placeholder->Mul => Placeholder->Multiply
/ /
Const-------/ Const-------/
"""
#
# Create Tensorflow model
#
import tensorflow as tf
tf.compat.v1.reset_default_graph()
@ -60,9 +56,7 @@ class TestMul(CommonTFLayerTest):
# TODO: implement tests for 2 Consts + Mul
test_data_1D = [
# Power
dict(x_shape=[1], y_shape=[1]),
# Eltwise
pytest.param(dict(x_shape=[3], y_shape=[3]), marks=pytest.mark.xfail(reason="*-19180"))
]
@ -76,14 +70,10 @@ class TestMul(CommonTFLayerTest):
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_2D = [
# Power
dict(x_shape=[1, 1], y_shape=[1, 1]),
# ScaleShift
dict(x_shape=[1, 3], y_shape=[1, 3]),
# Eltwise
pytest.param(dict(x_shape=[3, 1], y_shape=[3, 1]),
marks=pytest.mark.xfail(reason="*-19180")),
# Eltwise
dict(x_shape=[2, 3], y_shape=[2, 3])
]
@ -97,16 +87,12 @@ class TestMul(CommonTFLayerTest):
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_3D = [
# Power
dict(x_shape=[1, 1, 1], y_shape=[1, 1, 1]),
# ScaleShift
pytest.param(dict(x_shape=[1, 3, 1], y_shape=[1, 3, 1]),
marks=pytest.mark.xfail(reason="*-19053")),
# Eltwise
pytest.param(dict(x_shape=[1, 1, 3], y_shape=[1, 1, 3]),
marks=[pytest.mark.xfail(reason="*-19053"),
pytest.mark.xfail(reason="*-18830")]),
# Eltwise
pytest.param(dict(x_shape=[1, 3, 224], y_shape=[1, 3, 224]),
marks=pytest.mark.xfail(reason="*-19053"))
]
@ -121,14 +107,10 @@ class TestMul(CommonTFLayerTest):
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_4D = [
# Power
dict(x_shape=[1, 1, 1, 1], y_shape=[1, 1, 1, 1]),
# ScaleShift
dict(x_shape=[1, 3, 1, 1], y_shape=[1, 3, 1, 1]),
# Eltwise
pytest.param(dict(x_shape=[1, 1, 1, 3], y_shape=[1, 1, 1, 3]),
marks=pytest.mark.xfail(reason="*-19180")),
# Eltwise
dict(x_shape=[1, 3, 222, 224], y_shape=[1, 3, 222, 224])
]
@ -142,14 +124,10 @@ class TestMul(CommonTFLayerTest):
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_5D = [
# Power
dict(x_shape=[1, 1, 1, 1, 1], y_shape=[1, 1, 1, 1, 1]),
# ScaleShift
dict(x_shape=[1, 3, 1, 1, 1], y_shape=[1, 3, 1, 1, 1]),
# Eltwise
pytest.param(dict(x_shape=[1, 1, 1, 1, 3], y_shape=[1, 1, 1, 1, 3]),
marks=pytest.mark.xfail(reason="*-19180")),
# Eltwise
dict(x_shape=[1, 3, 50, 100, 224], y_shape=[1, 3, 50, 100, 224])
]
@ -183,15 +161,10 @@ class TestMul(CommonTFLayerTest):
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_broadcast_2D = [
# Power
dict(x_shape=[1, 1], y_shape=[1]),
# Power
dict(x_shape=[1, 3], y_shape=[1]),
# ScaleShift
dict(x_shape=[1, 3], y_shape=[3]),
# Eltwise
dict(x_shape=[3, 1], y_shape=[3]),
# Eltwise
pytest.param(dict(x_shape=[3, 1], y_shape=[1, 3, 1, 1]),
marks=pytest.mark.xfail(reason="*-19051"))
]
@ -206,24 +179,17 @@ class TestMul(CommonTFLayerTest):
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_broadcast_3D = [
# Power
dict(x_shape=[1, 1, 1], y_shape=[1]),
# Power
pytest.param(dict(x_shape=[1, 3, 1], y_shape=[1]),
marks=pytest.mark.xfail(reason="*-19053")),
# ScaleShift
pytest.param(dict(x_shape=[1, 3, 1], y_shape=[3]),
marks=pytest.mark.xfail(reason="*-19053")),
# Eltwise
pytest.param(dict(x_shape=[1, 3, 1], y_shape=[3, 1]),
marks=pytest.mark.xfail(reason="*-19053")),
# Eltwise
pytest.param(dict(x_shape=[1, 1, 1], y_shape=[3, 1]),
marks=pytest.mark.xfail(reason="*-19053")),
# Eltwise
pytest.param(dict(x_shape=[3, 1, 224], y_shape=[1, 3, 224]),
marks=pytest.mark.xfail(reason="*-19053")),
# Eltwise
pytest.param(dict(x_shape=[2, 3, 1], y_shape=[1, 3, 2]),
marks=pytest.mark.xfail(reason="*-19053")),
]
@ -239,25 +205,15 @@ class TestMul(CommonTFLayerTest):
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_broadcast_4D = [
# Power
dict(x_shape=[1, 1, 1, 1], y_shape=[1]),
# Power
dict(x_shape=[1, 3, 1, 1], y_shape=[1]),
# ScaleShift
dict(x_shape=[1, 3, 1, 1], y_shape=[3]),
# ScaleShift
dict(x_shape=[1, 3, 100, 224], y_shape=[3]),
# Eltwise
dict(x_shape=[1, 1, 1, 3], y_shape=[3]),
# Eltwise
dict(x_shape=[1, 3, 1, 1], y_shape=[3, 1]),
# Eltwise
dict(x_shape=[1, 2, 1, 3], y_shape=[3, 1, 2]),
# Eltwise
dict(x_shape=[1, 2, 1, 3], y_shape=[1, 3, 2]),
# Eltwise
dict(x_shape=[1, 3, 100, 224], y_shape=[1, 1, 1, 224]),
# Eltwise
dict(x_shape=[2, 3, 1, 2], y_shape=[1, 3, 2, 1])
]
@ -272,23 +228,14 @@ class TestMul(CommonTFLayerTest):
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_broadcast_5D = [
# Power
dict(x_shape=[1, 1, 1, 1, 1], y_shape=[1]),
# Power
dict(x_shape=[1, 3, 1, 1, 1], y_shape=[1, 1]),
# ScaleShift
pytest.param(dict(x_shape=[1, 3, 1, 1, 1], y_shape=[3]), marks=pytest.mark.precommit_tf_fe),
# Eltwise
dict(x_shape=[1, 1, 1, 1, 3], y_shape=[3]),
# Eltwise
dict(x_shape=[1, 3, 1, 1, 1], y_shape=[3, 1]),
# Eltwise
dict(x_shape=[1, 3, 1, 1, 2], y_shape=[1, 3, 2]),
# Eltwise
dict(x_shape=[1, 3, 5, 1, 2], y_shape=[5, 3, 2, 1]),
# Eltwise
dict(x_shape=[1, 3, 50, 100, 224], y_shape=[1, 1, 1, 1, 224]),
# Eltwise
dict(x_shape=[2, 3, 1, 2, 1], y_shape=[1, 3, 2, 1, 1])
]

View File

@ -23,10 +23,6 @@ class TestOneHot(CommonTFLayerTest):
Input (> 3D) -> Permute (NCHW -> NHWC) -> OneHot -> Permute (NHWC -> NCHW)
"""
#
# Create Tensorflow model
#
import tensorflow as tf
tf.compat.v1.reset_default_graph()

View File

@ -14,14 +14,10 @@ class TestPooling(CommonTFLayerTest):
"""
Tensorflow net IR net
Input->Pooling => Input->Pooling
Input->Pooling => Input->Pooling (AvgPool, MaxPool)
"""
#
# Create Tensorflow model
#
import tensorflow as tf
tf.compat.v1.reset_default_graph()

View File

@ -18,10 +18,6 @@ class TestReLU6(CommonTFLayerTest):
"""
#
# Create Tensorflow model
#
import tensorflow as tf
tf.compat.v1.reset_default_graph()

View File

@ -18,11 +18,6 @@ class TestResamplePattern(CommonTFLayerTest):
"""
The sub-graph in TF that could be expressed as a single Resample operation.
"""
#
# Create Tensorflow model
#
import tensorflow as tf
tf.compat.v1.reset_default_graph()

View File

@ -22,10 +22,6 @@ class TestRsqrt(CommonTFLayerTest):
"""
#
# Create Tensorflow model
#
import tensorflow as tf
tf.compat.v1.reset_default_graph()

View File

@ -19,10 +19,6 @@ class TestSelect(CommonTFLayerTest):
Input_2-----| Input_2-----|
"""
#
# Create Tensorflow model
#
import tensorflow as tf
tf.compat.v1.reset_default_graph()

View File

@ -18,10 +18,6 @@ class TestSoftsign(CommonTFLayerTest):
"""
#
# Create Tensorflow model
#
import tensorflow as tf
tf.compat.v1.reset_default_graph()

View File

@ -16,10 +16,6 @@ class TestSpaceToBatch(CommonTFLayerTest):
"""
#
# Create Tensorflow model
#
import tensorflow as tf
tf.compat.v1.reset_default_graph()

View File

@ -16,10 +16,6 @@ class TestSqueeze(CommonTFLayerTest):
"""
#
# Create Tensorflow model
#
import tensorflow as tf
tf.compat.v1.reset_default_graph()

View File

@ -12,9 +12,7 @@ class TestStridedSlice(CommonTFLayerTest):
def create_strided_slice_net(input_shape, begin, end, strides, begin_mask, end_mask,
ellipsis_mask,
new_axis_mask, shrink_axis_mask, ir_version, use_new_frontend):
#
# Create Tensorflow model
#
import tensorflow as tf
tf.compat.v1.reset_default_graph()

View File

@ -19,10 +19,6 @@ class TestSub(CommonTFLayerTest):
"""
#
# Create Tensorflow model
#
import tensorflow as tf
tf.compat.v1.reset_default_graph()
@ -61,9 +57,7 @@ class TestSub(CommonTFLayerTest):
# TODO: implement tests for 2 Consts + Sub
test_data_1D = [
# Power
dict(x_shape=[1], y_shape=[1]),
# Eltwise
dict(x_shape=[3], y_shape=[3])
]
@ -77,13 +71,9 @@ class TestSub(CommonTFLayerTest):
temp_dir=temp_dir, use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_2D = [
# Power
dict(x_shape=[1, 1], y_shape=[1, 1]),
# ScaleShift
dict(x_shape=[1, 3], y_shape=[1, 3]),
# Eltwise
dict(x_shape=[3, 1], y_shape=[3, 1]),
# Eltwise
dict(x_shape=[2, 3], y_shape=[2, 3])
]
@ -97,13 +87,9 @@ class TestSub(CommonTFLayerTest):
temp_dir=temp_dir, use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_3D = [
# Power
dict(x_shape=[1, 1, 1], y_shape=[1, 1, 1]),
# ScaleShift
dict(x_shape=[1, 3, 1], y_shape=[1, 3, 1]),
# Eltwise
dict(x_shape=[1, 1, 3], y_shape=[1, 1, 3]),
# Eltwise
pytest.param(dict(x_shape=[1, 3, 224], y_shape=[1, 3, 224]),
marks=pytest.mark.xfail(reason="*-19053"))
]
@ -119,13 +105,9 @@ class TestSub(CommonTFLayerTest):
temp_dir=temp_dir, use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_4D = [
# Power
dict(x_shape=[1, 1, 1, 1], y_shape=[1, 1, 1, 1]),
# ScaleShift
dict(x_shape=[1, 3, 1, 1], y_shape=[1, 3, 1, 1]),
# Eltwise
dict(x_shape=[1, 1, 1, 3], y_shape=[1, 1, 1, 3]),
# Eltwise
dict(x_shape=[1, 3, 222, 224], y_shape=[1, 3, 222, 224])
]
@ -140,13 +122,9 @@ class TestSub(CommonTFLayerTest):
temp_dir=temp_dir, use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_5D = [
# Power
dict(x_shape=[1, 1, 1, 1, 1], y_shape=[1, 1, 1, 1, 1]),
# ScaleShift
dict(x_shape=[1, 3, 1, 1, 1], y_shape=[1, 3, 1, 1, 1]),
# Eltwise
dict(x_shape=[1, 1, 1, 1, 3], y_shape=[1, 1, 1, 1, 3]),
# Eltwise
dict(x_shape=[1, 3, 50, 100, 224], y_shape=[1, 3, 50, 100, 224])
]
@ -166,7 +144,7 @@ class TestSub(CommonTFLayerTest):
# #
###############################################################################################
test_data_broadcast_1D = [ # Power
test_data_broadcast_1D = [
dict(x_shape=[3], y_shape=[1])
]
@ -180,15 +158,10 @@ class TestSub(CommonTFLayerTest):
temp_dir=temp_dir, use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_broadcast_2D = [
# Power
dict(x_shape=[1, 1], y_shape=[1]),
# Power
dict(x_shape=[1, 3], y_shape=[1]),
# ScaleShift
dict(x_shape=[1, 3], y_shape=[3]),
# Eltwise
dict(x_shape=[3, 1], y_shape=[3]),
# Eltwise
dict(x_shape=[3, 1], y_shape=[1, 3, 1, 1]),
]
@ -202,19 +175,12 @@ class TestSub(CommonTFLayerTest):
temp_dir=temp_dir, use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_broadcast_3D = [
# Power
dict(x_shape=[1, 1, 1], y_shape=[1]),
# Power
dict(x_shape=[1, 3, 1], y_shape=[1]),
# ScaleShift
dict(x_shape=[1, 3, 1], y_shape=[3]),
# Eltwise
dict(x_shape=[1, 3, 1], y_shape=[3, 1]),
# Eltwise
dict(x_shape=[1, 1, 1], y_shape=[3, 1]),
# Eltwise
dict(x_shape=[3, 1, 224], y_shape=[1, 3, 224]),
# Eltwise
dict(x_shape=[2, 3, 1], y_shape=[1, 3, 2]),
]
@ -229,25 +195,15 @@ class TestSub(CommonTFLayerTest):
temp_dir=temp_dir, use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_broadcast_4D = [
# Power
dict(x_shape=[1, 1, 1, 1], y_shape=[1]),
# Power
dict(x_shape=[1, 3, 1, 1], y_shape=[1]),
# ScaleShift
dict(x_shape=[1, 3, 1, 1], y_shape=[3]),
# Eltwise
dict(x_shape=[1, 3, 100, 224], y_shape=[3]),
# Eltwise
dict(x_shape=[1, 1, 1, 3], y_shape=[3]),
# Eltwise
dict(x_shape=[1, 3, 1, 1], y_shape=[3, 1]),
# Eltwise
dict(x_shape=[1, 3, 1, 2], y_shape=[3, 1, 2]),
# Eltwise
dict(x_shape=[1, 3, 1, 2], y_shape=[1, 3, 2]),
# Eltwise
dict(x_shape=[1, 3, 100, 224], y_shape=[1, 1, 1, 224]),
# Eltwise
dict(x_shape=[2, 3, 1, 2], y_shape=[1, 3, 2, 1])
]
@ -262,23 +218,14 @@ class TestSub(CommonTFLayerTest):
temp_dir=temp_dir, use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_broadcast_5D = [
# Power
dict(x_shape=[1, 1, 1, 1, 1], y_shape=[1, 1, 1, 1, 1]),
# Power
dict(x_shape=[1, 3, 1, 1, 1], y_shape=[1, 1]),
# ScaleShift
dict(x_shape=[1, 3, 1, 1, 1], y_shape=[3]),
# Eltwise
dict(x_shape=[1, 1, 1, 1, 3], y_shape=[3]),
# Eltwise
dict(x_shape=[1, 3, 1, 1, 1], y_shape=[3, 1]),
# Eltwise
pytest.param(dict(x_shape=[1, 3, 1, 1, 2], y_shape=[1, 3, 2]), marks=pytest.mark.precommit_tf_fe),
# Eltwise
dict(x_shape=[1, 3, 5, 1, 2], y_shape=[5, 3, 2, 1]),
# Eltwise
dict(x_shape=[1, 3, 50, 100, 224], y_shape=[1, 1, 1, 1, 224]),
# Eltwise
dict(x_shape=[2, 3, 1, 2, 1], y_shape=[1, 3, 2, 1, 1])
]

View File

@ -18,10 +18,6 @@ class TestSwish(CommonTFLayerTest):
"""
#
# Create Tensorflow model
#
import tensorflow as tf
tf.reset_default_graph()

View File

@ -29,10 +29,6 @@ class Test_TopK(CommonTFLayerTest):
"""
#
# Create Tensorflow model
#
import tensorflow as tf
tf.compat.v1.reset_default_graph()

View File

@ -82,10 +82,6 @@ class TestUnaryOps(CommonTFLayerTest):
'ReLU': tf.nn.relu,
}
#
# Create Tensorflow model
#
tf.compat.v1.reset_default_graph()
type = tf.float32