Files
openvino/tests/layer_tests/tensorflow_tests/test_tf_LinSpace.py
Roman Kazantsev 2cae7479a0 [TF FE] Refactor LinSpace translator and add layer test (#15495)
* [TF FE] Refactor LinSpace translator and add layer test

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

* Remove start_shape from test parameters

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-02-03 20:14:47 +00:00

36 lines
1.2 KiB
Python

# Copyright (C) 2018-2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
import tensorflow as tf
from common.tf_layer_test_class import CommonTFLayerTest
class TestLinSpace(CommonTFLayerTest):
def create_lin_space_net(self, num_value):
tf.compat.v1.reset_default_graph()
# Create the graph and model
with tf.compat.v1.Session() as sess:
start = tf.compat.v1.placeholder(tf.float32, [], 'start')
stop = tf.compat.v1.placeholder(tf.float32, [], 'stop')
tf.raw_ops.LinSpace(start=start, stop=stop, num=num_value)
tf.compat.v1.global_variables_initializer()
tf_net = sess.graph_def
return tf_net, None
test_data_basic = [
dict(num_value=2),
dict(num_value=10),
]
@pytest.mark.parametrize("params", test_data_basic)
@pytest.mark.precommit_tf_fe
@pytest.mark.nightly
def test_lin_space_basic(self, params, ie_device, precision, ir_version, temp_dir,
use_new_frontend, use_old_api):
self._test(*self.create_lin_space_net(**params),
ie_device, precision, ir_version, temp_dir=temp_dir,
use_new_frontend=use_new_frontend, use_old_api=use_old_api)