[TF FE] Refactor Concat layer test and extend pre-commit (#15726)

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
This commit is contained in:
Roman Kazantsev
2023-02-15 15:25:05 +04:00
committed by GitHub
parent fb3d785c06
commit ad20add992

View File

@@ -28,69 +28,89 @@ class TestConcat(CommonTFLayerTest):
ref_net = None
return tf_net, ref_net
test_data_1D = [dict(input_shapes=[[1], [2]], axis=0, is_v2=False),
dict(input_shapes=[[1], [3]], axis=-1, is_v2=True)]
test_data_basic = [
dict(input_shapes=[[1], [3]], axis=-1, is_v2=True),
dict(input_shapes=[[3, 4]], axis=0, is_v2=True),
dict(input_shapes=[[1, 3, 5], [2, 3, 5]], axis=0, is_v2=False),
dict(input_shapes=[[1, 3, 5, 7, 8], [1, 3, 2, 7, 8]], axis=2, is_v2=False),
dict(input_shapes=[[1, 3, 5, 7, 2], [1, 3, 5, 7, 3], [1, 3, 5, 7, 2], [1, 3, 5, 7, 4]],
axis=-1, is_v2=True),
]
@pytest.mark.parametrize("params", test_data_basic)
@pytest.mark.precommit_tf_fe
@pytest.mark.nightly
def test_concat_basic(self, params, ie_device, precision, ir_version, temp_dir, use_new_frontend,
use_old_api):
self._test(*self.create_concat_net(**params, ir_version=ir_version,
use_new_frontend=use_new_frontend),
ie_device, precision, ir_version, temp_dir=temp_dir,
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_1D = [
dict(input_shapes=[[1], [2]], axis=0, is_v2=False),
]
@pytest.mark.parametrize("params", test_data_1D)
@pytest.mark.nightly
def test_concat_1D(self, params, ie_device, precision, ir_version, temp_dir, use_new_frontend,
use_old_api):
self._test(*self.create_concat_net(**params, ir_version=ir_version,
use_new_frontend=use_new_frontend),
use_new_frontend=use_new_frontend),
ie_device, precision, ir_version, temp_dir=temp_dir,
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_2D = [dict(input_shapes=[[3, 4]], axis=0, is_v2=True),
dict(input_shapes=[[1, 4], [1, 2]], axis=-1, is_v2=True)]
test_data_2D = [
dict(input_shapes=[[1, 4], [1, 2]], axis=-1, is_v2=True)
]
@pytest.mark.parametrize("params", test_data_2D)
@pytest.mark.nightly
def test_concat_2D(self, params, ie_device, precision, ir_version, temp_dir, use_new_frontend,
use_old_api):
self._test(*self.create_concat_net(**params, ir_version=ir_version,
use_new_frontend=use_new_frontend),
use_new_frontend=use_new_frontend),
ie_device, precision, ir_version, temp_dir=temp_dir,
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_3D = [
dict(input_shapes=[[1, 3, 5], [2, 3, 5]], axis=0, is_v2=False),
dict(input_shapes=[[1, 3, 2], [1, 3, 5]], axis=-1, is_v2=True),
dict(input_shapes=[[1, 3, 1], [1, 3, 4], [1, 3, 3]], axis=2, is_v2=True)]
dict(input_shapes=[[1, 3, 1], [1, 3, 4], [1, 3, 3]], axis=2, is_v2=True)
]
@pytest.mark.parametrize("params", test_data_3D)
@pytest.mark.nightly
@pytest.mark.precommit_tf_fe
def test_concat_3D(self, params, ie_device, precision, ir_version, temp_dir, use_new_frontend,
use_old_api):
self._test(*self.create_concat_net(**params, ir_version=ir_version,
use_new_frontend=use_new_frontend),
use_new_frontend=use_new_frontend),
ie_device, precision, ir_version, temp_dir=temp_dir,
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_4D = [dict(input_shapes=[[1, 3, 5, 7], [3, 3, 5, 7], [2, 3, 5, 7]], axis=0, is_v2=False),
dict(input_shapes=[[1, 3, 5, 5], [1, 3, 5, 7]], axis=-1, is_v2=True),
dict(input_shapes=[[1, 3, 5, 7], [1, 3, 3, 7]], axis=2, is_v2=False)]
test_data_4D = [
dict(input_shapes=[[1, 3, 5, 7], [3, 3, 5, 7], [2, 3, 5, 7]], axis=0, is_v2=False),
dict(input_shapes=[[1, 3, 5, 5], [1, 3, 5, 7]], axis=-1, is_v2=True),
dict(input_shapes=[[1, 3, 5, 7], [1, 3, 3, 7]], axis=2, is_v2=False)
]
@pytest.mark.parametrize("params", test_data_4D)
@pytest.mark.nightly
@pytest.mark.precommit
def test_concat_4D(self, params, ie_device, precision, ir_version, temp_dir, use_new_frontend,
use_old_api):
self._test(*self.create_concat_net(**params, ir_version=ir_version,
use_new_frontend=use_new_frontend),
use_new_frontend=use_new_frontend),
ie_device, precision, ir_version, temp_dir=temp_dir,
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
test_data_5D = [dict(input_shapes=[[1, 3, 5, 7, 8], [2, 3, 5, 7, 8]], axis=0, is_v2=True),
dict(input_shapes=[[1, 3, 5, 7, 2], [1, 3, 5, 7, 3], [1, 3, 5, 7, 2], [1, 3, 5, 7, 4]],
axis=-1, is_v2=True),
dict(input_shapes=[[1, 3, 5, 7, 8], [1, 3, 2, 7, 8]], axis=2, is_v2=False)]
test_data_5D = [
dict(input_shapes=[[1, 3, 5, 7, 8], [2, 3, 5, 7, 8]], axis=0, is_v2=True),
]
@pytest.mark.parametrize("params", test_data_5D)
@pytest.mark.nightly
def test_concat_5D(self, params, ie_device, precision, ir_version, temp_dir, use_new_frontend,
use_old_api):
self._test(*self.create_concat_net(**params, ir_version=ir_version,
use_new_frontend=use_new_frontend),
use_new_frontend=use_new_frontend),
ie_device, precision, ir_version, temp_dir=temp_dir,
use_new_frontend=use_new_frontend, use_old_api=use_old_api)