Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[core] Remove LSTM sequence v0 (#27330)

Pawel Raasz59ddd74211f0
diff --git a/src/bindings/python/src/openvino/runtime/opset1/__init__.py b/src/bindings/python/src/openvino/runtime/opset1/__init__.py
index 5bfa42f43f2..ca7e1aef385 100644
--- a/src/bindings/python/src/openvino/runtime/opset1/__init__.py
+++ b/src/bindings/python/src/openvino/runtime/opset1/__init__.py
@@ -54,7 +54,6 @@ from openvino.runtime.opset1.ops import logical_or
from openvino.runtime.opset1.ops import logical_xor
from openvino.runtime.opset1.ops import lrn
from openvino.runtime.opset1.ops import lstm_cell
-from openvino.runtime.opset1.ops import lstm_sequence
from openvino.runtime.opset1.ops import matmul
from openvino.runtime.opset1.ops import max_pool
from openvino.runtime.opset1.ops import maximum
diff --git a/src/bindings/python/src/openvino/runtime/opset1/ops.py b/src/bindings/python/src/openvino/runtime/opset1/ops.py
index c100a6c2db2..54f32d40433 100644
--- a/src/bindings/python/src/openvino/runtime/opset1/ops.py
+++ b/src/bindings/python/src/openvino/runtime/opset1/ops.py
@@ -1532,95 +1532,6 @@ def lstm_cell(
return _get_node_factory_opset1().create("LSTMCell", node_inputs, attributes)
-@deprecated(version="2025.0", message="Use lstm_sequence from opset 5")
-@nameable_op
-def lstm_sequence(
- X: NodeInput,
- initial_hidden_state: NodeInput,
- initial_cell_state: NodeInput,
- sequence_lengths: NodeInput,
- W: NodeInput,
- R: NodeInput,
- B: NodeInput,
- hidden_size: int,
- direction: str,
- activations: Optional[List[str]] = None,
- activations_alpha: Optional[List[float]] = None,
- activations_beta: Optional[List[float]] = None,
- clip: float = 0.0,
- name: Optional[str] = None,
-) -> Node:
- """Return a node which performs LSTMSequence operation.
-
- :param X: The input tensor. Shape: [batch_size, seq_length, input_size].
- :param initial_hidden_state: The hidden state tensor.
- Shape: [batch_size, num_directions, hidden_size].
- :param initial_cell_state: The cell state tensor.
- Shape: [batch_size, num_directions, hidden_size].
- :param sequence_lengths: Specifies real sequence lengths for each batch element.
- Shape: [batch_size]. Integer type.
- :param W: Tensor with weights for matrix multiplication operation with input portion of data.
- Shape: [num_directions, 4*hidden_size, input_size].
- :param R: The tensor with weights for matrix multiplication operation with hidden state.
- Shape: [num_directions, 4*hidden_size, hidden_size].
- :param B: The tensor with biases.
- Shape: [num_directions, 4*hidden_size].
- :param hidden_size: Specifies hidden state size.
- :param direction: Specifies if the RNN is forward, reverse, or bidirectional.
- :param activations: The list of three activation functions for gates.
- :param activations_alpha: The list of alpha parameters for activation functions.
- :param activations_beta: The list of beta parameters for activation functions.
- :param clip: Specifies bound values [-C, C] for tensor clipping performed before activations.
- :param name: An optional name of the output node.
-
- :return: The new node represents LSTMSequence. Node outputs count: 3.
- """
- if activations is None:
- activations = ["sigmoid", "tanh", "tanh"]
- if activations_alpha is None:
- activations_alpha = []
- if activations_beta is None:
- activations_beta = []
-
- node_inputs = as_nodes(
- X,
- initial_hidden_state,
- initial_cell_state,
- sequence_lengths,
- W,
- R,
- B,
- name=name,
- )
-
- # P - nGraph additional input, no such input in the OV spec
- peepholes_count = 3 # nGraph default
- if direction.lower() == "bidirectional":
- num_directions = 2
- else:
- num_directions = 1
- peepholes_shape = [num_directions, peepholes_count * hidden_size]
- peepholes_array = np.zeros(peepholes_shape) # nGraph default
- data_dtype = get_dtype(node_inputs[0].get_output_element_type(0))
- default_p = make_constant_node(peepholes_array, dtype=data_dtype)
- node_inputs.append(default_p)
-
- weights_format = "fico" # OV LSTMWeightsFormat, no such attribute in the OV spec
- input_forget = False # nGraph default, no such attribute in the OV spec
-
- attributes = {
- "hidden_size": hidden_size,
- "direction": direction.lower(),
- "activations": activations,
- "activations_alpha": activations_alpha,
- "activations_beta": activations_beta,
- "clip": clip,
- "weights_format": weights_format,
- "input_forget": input_forget,
- }
- return _get_node_factory_opset1().create("LSTMSequence", node_inputs, attributes)
-
-
@nameable_op
def matmul(
data_a: NodeInput,
diff --git a/src/bindings/python/src/openvino/runtime/opset2/__init__.py b/src/bindings/python/src/openvino/runtime/opset2/__init__.py
index 34d0d9b6737..6624149e157 100644
--- a/src/bindings/python/src/openvino/runtime/opset2/__init__.py
+++ b/src/bindings/python/src/openvino/runtime/opset2/__init__.py
@@ -56,7 +56,6 @@ from openvino.runtime.opset1.ops import logical_or
from openvino.runtime.opset1.ops import logical_xor
from openvino.runtime.opset1.ops import lrn
from openvino.runtime.opset1.ops import lstm_cell
-from openvino.runtime.opset1.ops import lstm_sequence
from openvino.runtime.opset1.ops import matmul
from openvino.runtime.opset1.ops import max_pool
from openvino.runtime.opset1.ops import maximum
diff --git a/src/bindings/python/src/openvino/runtime/opset3/__init__.py b/src/bindings/python/src/openvino/runtime/opset3/__init__.py
index 964acb15b34..5bd68912cae 100644
--- a/src/bindings/python/src/openvino/runtime/opset3/__init__.py
+++ b/src/bindings/python/src/openvino/runtime/opset3/__init__.py
@@ -65,7 +65,6 @@ from openvino.runtime.opset1.ops import logical_or
from openvino.runtime.opset1.ops import logical_xor
from openvino.runtime.opset1.ops import lrn
from openvino.runtime.opset1.ops import lstm_cell
-from openvino.runtime.opset1.ops import lstm_sequence
from openvino.runtime.opset1.ops import matmul
from openvino.runtime.opset1.ops import max_pool
from openvino.runtime.opset1.ops import maximum
diff --git a/src/bindings/python/src/openvino/runtime/opset4/__init__.py b/src/bindings/python/src/openvino/runtime/opset4/__init__.py
index bf57172bed4..e7cef8eb216 100644
--- a/src/bindings/python/src/openvino/runtime/opset4/__init__.py
+++ b/src/bindings/python/src/openvino/runtime/opset4/__init__.py
@@ -70,7 +70,6 @@ from openvino.runtime.opset1.ops import logical_or
from openvino.runtime.opset1.ops import logical_xor
from openvino.runtime.opset1.ops import lrn
from openvino.runtime.opset4.ops import lstm_cell
-from openvino.runtime.opset1.ops import lstm_sequence
from openvino.runtime.opset1.ops import matmul
from openvino.runtime.opset1.ops import max_pool
from openvino.runtime.opset1.ops import maximum
diff --git a/src/bindings/python/tests/test_graph/test_create_op.py b/src/bindings/python/tests/test_graph/test_create_op.py
index 98d0ec35838..f86ea4a18a8 100644
--- a/src/bindings/python/tests/test_graph/test_create_op.py
+++ b/src/bindings/python/tests/test_graph/test_create_op.py
@@ -315,264 +315,6 @@ def test_lstm_cell_operator(dtype):
assert list(node_param.get_output_shape(1)) == [1, 128]
[email protected]("dtype", [np.float32, np.float64])
[email protected]("op_name", ["lstm", "lstmOpset1"])
-def test_lstm_cell_operator_opset1(dtype, op_name):
- batch_size = 1
- input_size = 16
- hidden_size = 128
-
- x_shape = [batch_size, input_size]
- h_t_shape = [batch_size, hidden_size]
- c_t_shape = [batch_size, hidden_size]
- w_shape = [4 * hidden_size, input_size]
- r_shape = [4 * hidden_size, hidden_size]
- b_shape = [4 * hidden_size]
-
- parameter_x = ov.parameter(x_shape, name="X", dtype=dtype)
- parameter_h_t = ov.parameter(h_t_shape, name="H_t", dtype=dtype)
- parameter_c_t = ov.parameter(c_t_shape, name="C_t", dtype=dtype)
- parameter_w = ov.parameter(w_shape, name="W", dtype=dtype)
- parameter_r = ov.parameter(r_shape, name="R", dtype=dtype)
- parameter_b = ov.parameter(b_shape, name="B", dtype=dtype)
-
- node_default = ov_opset1.lstm_cell(
- parameter_x, parameter_h_t, parameter_c_t, parameter_w, parameter_r, parameter_b, hidden_size, name=op_name,
- )
-
- assert node_default.get_type_name() == "LSTMCell"
- assert node_default.get_friendly_name() == op_name
- assert node_default.get_output_size() == 2
- assert list(node_default.get_output_shape(0)) == [1, 128]
- assert list(node_default.get_output_shape(1)) == [1, 128]
-
- activations = ["tanh", "Sigmoid", "RELU"]
- activation_alpha = [1.0, 2.0, 3.0]
- activation_beta = [3.0, 2.0, 1.0]
- clip = 0.5
-
- node_param = ov_opset1.lstm_cell(
- parameter_x,
- parameter_h_t,
- parameter_c_t,
- parameter_w,
- parameter_r,
- parameter_b,
- hidden_size,
- activations,
- activation_alpha,
- activation_beta,
- clip,
- )
-
- assert node_param.get_type_name() == "LSTMCell"
- assert node_param.get_output_size() == 2
- assert list(node_param.get_output_shape(0)) == [1, 128]
- assert list(node_param.get_output_shape(1)) == [1, 128]
-
-
[email protected]("dtype", [np.float32, np.float64])
[email protected]("op_name", ["lstm", "lstmOpset1"])
-def test_lstm_sequence_operator_bidirectional_opset1(dtype, op_name):
- batch_size = 1
- input_size = 16
- hidden_size = 128
- num_directions = 2
- seq_length = 2
-
- x_shape = [batch_size, seq_length, input_size]
- h_t_shape = [batch_size, num_directions, hidden_size]
- c_t_shape = [batch_size, num_directions, hidden_size]
- seq_len_shape = [batch_size]
- w_shape = [num_directions, 4 * hidden_size, input_size]
- r_shape = [num_directions, 4 * hidden_size, hidden_size]
- b_shape = [num_directions, 4 * hidden_size]
-
- parameter_x = ov.parameter(x_shape, name="X", dtype=dtype)
- parameter_h_t = ov.parameter(h_t_shape, name="H_t", dtype=dtype)
- parameter_c_t = ov.parameter(c_t_shape, name="C_t", dtype=dtype)
- parameter_seq_len = ov.parameter(seq_len_shape, name="seq_len", dtype=np.int32)
- parameter_w = ov.parameter(w_shape, name="W", dtype=dtype)
- parameter_r = ov.parameter(r_shape, name="R", dtype=dtype)
- parameter_b = ov.parameter(b_shape, name="B", dtype=dtype)
-
- direction = "BIDIRECTIONAL"
- with pytest.warns(DeprecationWarning):
- node = ov_opset1.lstm_sequence(
- parameter_x,
- parameter_h_t,
- parameter_c_t,
- parameter_seq_len,
- parameter_w,
- parameter_r,
- parameter_b,
- hidden_size,
- direction,
- name=op_name,
- )
-
- assert node.get_type_name() == "LSTMSequence"
- assert node.get_friendly_name() == op_name
- assert node.get_output_size() == 3
-
- activations = ["RELU", "tanh", "Sigmoid"]
- activation_alpha = [1.0, 2.0, 3.0]
- activation_beta = [3.0, 2.0, 1.0]
- clip = 1.22
-
- with pytest.warns(DeprecationWarning):
- node_param = ov_opset1.lstm_sequence(
- parameter_x,
- parameter_h_t,
- parameter_c_t,
- parameter_seq_len,
- parameter_w,
- parameter_r,
- parameter_b,
- hidden_size,
- direction,
- activations,
- activation_alpha,
- activation_beta,
- clip,
- )
-
- assert node_param.get_type_name() == "LSTMSequence"
- assert node_param.get_output_size() == 3
-
-
[email protected]("dtype", [np.float32, np.float64])
-def test_lstm_sequence_operator_reverse_opset1(dtype):
- batch_size = 2
- input_size = 4
- hidden_size = 3
- num_directions = 1
- seq_length = 2
-
- x_shape = [batch_size, seq_length, input_size]
- h_t_shape = [batch_size, num_directions, hidden_size]
- c_t_shape = [batch_size, num_directions, hidden_size]
- seq_len_shape = [batch_size]
- w_shape = [num_directions, 4 * hidden_size, input_size]
- r_shape = [num_directions, 4 * hidden_size, hidden_size]
- b_shape = [num_directions, 4 * hidden_size]
-
- parameter_x = ov.parameter(x_shape, name="X", dtype=dtype)
- parameter_h_t = ov.parameter(h_t_shape, name="H_t", dtype=dtype)
- parameter_c_t = ov.parameter(c_t_shape, name="C_t", dtype=dtype)
- parameter_seq_len = ov.parameter(seq_len_shape, name="seq_len", dtype=np.int32)
- parameter_w = ov.parameter(w_shape, name="W", dtype=dtype)
- parameter_r = ov.parameter(r_shape, name="R", dtype=dtype)
- parameter_b = ov.parameter(b_shape, name="B", dtype=dtype)
-
- direction = "REVERSE"
- with pytest.warns(DeprecationWarning):
- node_default = ov_opset1.lstm_sequence(
- parameter_x,
- parameter_h_t,
- parameter_c_t,
- parameter_seq_len,
- parameter_w,
- parameter_r,
- parameter_b,
- hidden_size,
- direction,
- )
-
- assert node_default.get_type_name() == "LSTMSequence"
- assert node_default.get_output_size() == 3
-
- activations = ["RELU", "tanh", "Sigmoid"]
- activation_alpha = [1.0, 2.0, 3.0]
- activation_beta = [3.0, 2.0, 1.0]
- clip = 1.22
- with pytest.warns(DeprecationWarning):
- node_param = ov_opset1.lstm_sequence(
- parameter_x,
- parameter_h_t,
- parameter_c_t,
- parameter_seq_len,
- parameter_w,
- parameter_r,
- parameter_b,
- hidden_size,
- direction,
- activations,
- activation_alpha,
- activation_beta,
- clip,
- )
-
- assert node_param.get_type_name() == "LSTMSequence"
- assert node_param.get_output_size() == 3
-
-
[email protected]("dtype", [np.float32, np.float64])
-def test_lstm_sequence_operator_forward_opset1(dtype):
- batch_size = 2
- input_size = 4
- hidden_size = 3
- num_directions = 1
- seq_length = 2
-
- x_shape = [batch_size, seq_length, input_size]
- h_t_shape = [batch_size, num_directions, hidden_size]
- c_t_shape = [batch_size, num_directions, hidden_size]
- seq_len_shape = [batch_size]
- w_shape = [num_directions, 4 * hidden_size, input_size]
- r_shape = [num_directions, 4 * hidden_size, hidden_size]
- b_shape = [num_directions, 4 * hidden_size]
-
- parameter_x = ov.parameter(x_shape, name="X", dtype=dtype)
- parameter_h_t = ov.parameter(h_t_shape, name="H_t", dtype=dtype)
- parameter_c_t = ov.parameter(c_t_shape, name="C_t", dtype=dtype)
- parameter_seq_len = ov.parameter(seq_len_shape, name="seq_len", dtype=np.int32)
- parameter_w = ov.parameter(w_shape, name="W", dtype=dtype)
- parameter_r = ov.parameter(r_shape, name="R", dtype=dtype)
- parameter_b = ov.parameter(b_shape, name="B", dtype=dtype)
-
- direction = "forward"
- with pytest.warns(DeprecationWarning):
- node_default = ov_opset1.lstm_sequence(
- parameter_x,
- parameter_h_t,
- parameter_c_t,
- parameter_seq_len,
- parameter_w,
- parameter_r,
- parameter_b,
- hidden_size,
- direction,
- )
-
- assert node_default.get_type_name() == "LSTMSequence"
- assert node_default.get_output_size() == 3
-
- activations = ["RELU", "tanh", "Sigmoid"]
- activation_alpha = [2.0]
- activation_beta = [1.0]
- clip = 0.5
- with pytest.warns(DeprecationWarning):
- node = ov_opset1.lstm_sequence(
- parameter_x,
- parameter_h_t,
- parameter_c_t,
- parameter_seq_len,
- parameter_w,
- parameter_r,
- parameter_b,
- hidden_size,
- direction,
- activations,
- activation_alpha,
- activation_beta,
- clip,
- )
-
- assert node.get_type_name() == "LSTMSequence"
- assert node.get_output_size() == 3
-
-
def test_gru_cell_operator():
batch_size = 1
input_size = 16
diff --git a/src/core/include/openvino/op/lstm_sequence.hpp b/src/core/include/openvino/op/lstm_sequence.hpp
index 4d68b5ceb7f..28f5a2b1b8b 100644
--- a/src/core/include/openvino/op/lstm_sequence.hpp
+++ b/src/core/include/openvino/op/lstm_sequence.hpp
@@ -17,103 +17,6 @@
namespace ov {
namespace op {
-namespace v0 {
-
-///
-/// \brief Class for lstm sequence node.
-///
-/// \note It follows notation and equations defined as in ONNX standard:
-/// https://github.com/onnx/onnx/blob/master/docs/Operators.md#LSTM
-///
-/// \sa LSTMCell, RNNCell, GRUCell
-///
-///
-/// \ingroup ov_ops_cpp_api
-class OPENVINO_API OPENVINO_DEPRECATED(
- "The class ov::op::v0::LSTMSequence is deprecated. It will be removed in 2025.0 release. Use "
- "ov::op::v5::LSTMSequence instead.") LSTMSequence : public util::RNNCellBase {
-public:
- OPENVINO_OP("LSTMSequence", "opset1", util::RNNCellBase);
- LSTMSequence() = default;
-
- using direction = RecurrentSequenceDirection;
-
- size_t get_default_output_index() const override {
- return no_default_index();
- }
- explicit LSTMSequence(const Output<Node>& X,
- const Output<Node>& initial_hidden_state,
- const Output<Node>& initial_cell_state,
- const Output<Node>& sequence_lengths,
- const Output<Node>& W,
- const Output<Node>& R,
- const Output<Node>& B,
- const Output<Node>& P,
- const std::int64_t hidden_size,
- const direction lstm_direction,
- LSTMWeightsFormat weights_format = LSTMWeightsFormat::IFCO,
- const std::vector<float> activations_alpha = {},
- const std::vector<float> activations_beta = {},
- const std::vector<std::string> activations = {"sigmoid", "tanh", "tanh"},
- const float clip_threshold = 0,
- const bool input_forget = false);
-
- explicit LSTMSequence(const Output<Node>& X,
- const Output<Node>& initial_hidden_state,
- const Output<Node>& initial_cell_state,
- const Output<Node>& sequence_lengths,
- const Output<Node>& W,
- const Output<Node>& R,
- const Output<Node>& B,
- const std::int64_t hidden_size,
- const direction lstm_direction,
- LSTMWeightsFormat weights_format = LSTMWeightsFormat::IFCO,
- const std::vector<float>& activations_alpha = {},
- const std::vector<float>& activations_beta = {},
- const std::vector<std::string>& activations = {"sigmoid", "tanh", "tanh"},
- const float clip_threshold = 0,
- const bool input_forget = false);
-
- void validate_and_infer_types() override;
- bool visit_attributes(AttributeVisitor& visitor) override;
-
- std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& new_args) const override;
-
- std::vector<float> get_activations_alpha() const {
- return m_activations_alpha;
- }
- std::vector<float> get_activations_beta() const {
- return m_activations_beta;
- }
- std::vector<std::string> get_activations() const {
- return m_activations;
- }
- float get_clip_threshold() const {
- return m_clip;
- }
- direction get_direction() const {
- return m_direction;
- }
- void set_direction(const direction& dir) {
- m_direction = dir;
- }
- std::int64_t get_hidden_size() const {
- return m_hidden_size;
- }
- bool get_input_forget() const {
- return m_input_forget;
- }
- LSTMWeightsFormat get_weights_format() const {
- return m_weights_format;
- }
-
-private:
- direction m_direction;
- bool m_input_forget;
- LSTMWeightsFormat m_weights_format;
-};
-} // namespace v0
-
namespace v5 {
///
/// \brief Class for lstm sequence node.
diff --git a/src/core/include/openvino/opsets/opset1.hpp b/src/core/include/openvino/opsets/opset1.hpp
index 80ea1b517e4..e2a7a159299 100644
--- a/src/core/include/openvino/opsets/opset1.hpp
+++ b/src/core/include/openvino/opsets/opset1.hpp
@@ -9,9 +9,7 @@
namespace ov {
namespace opset1 {
#define _OPENVINO_OP_REG(a, b) using b::a;
-OPENVINO_SUPPRESS_DEPRECATED_START
#include "openvino/opsets/opset1_tbl.hpp"
-OPENVINO_SUPPRESS_DEPRECATED_END
#undef _OPENVINO_OP_REG
} // namespace opset1
} // namespace ov
diff --git a/src/core/include/openvino/opsets/opset1_tbl.hpp b/src/core/include/openvino/opsets/opset1_tbl.hpp
index 089df5896e6..3008e450065 100644
--- a/src/core/include/openvino/opsets/opset1_tbl.hpp
+++ b/src/core/include/openvino/opsets/opset1_tbl.hpp
@@ -88,7 +88,6 @@ _OPENVINO_OP_REG(LogicalOr, ov::op::v1)
_OPENVINO_OP_REG(LogicalXor, ov::op::v1)
_OPENVINO_OP_REG(LRN, ov::op::v0)
_OPENVINO_OP_REG(LSTMCell, ov::op::v0)
-_OPENVINO_OP_REG(LSTMSequence, ov::op::v0)
_OPENVINO_OP_REG(MatMul, ov::op::v0)
_OPENVINO_OP_REG(MaxPool, ov::op::v1)
_OPENVINO_OP_REG(Maximum, ov::op::v1)
diff --git a/src/core/include/openvino/opsets/opset2.hpp b/src/core/include/openvino/opsets/opset2.hpp
index 3c0888c0a88..bcdaa6a1bc3 100644
--- a/src/core/include/openvino/opsets/opset2.hpp
+++ b/src/core/include/openvino/opsets/opset2.hpp
@@ -9,9 +9,7 @@
namespace ov {
namespace opset2 {
#define _OPENVINO_OP_REG(a, b) using b::a;
-OPENVINO_SUPPRESS_DEPRECATED_START
#include "openvino/opsets/opset2_tbl.hpp"
-OPENVINO_SUPPRESS_DEPRECATED_END
#undef _OPENVINO_OP_REG
} // namespace opset2
} // namespace ov
diff --git a/src/core/include/openvino/opsets/opset2_tbl.hpp b/src/core/include/openvino/opsets/opset2_tbl.hpp
index 1d7c55ea745..e14887aaced 100644
--- a/src/core/include/openvino/opsets/opset2_tbl.hpp
+++ b/src/core/include/openvino/opsets/opset2_tbl.hpp
@@ -57,7 +57,6 @@ _OPENVINO_OP_REG(LogicalOr, ov::op::v1)
_OPENVINO_OP_REG(LogicalXor, ov::op::v1)
_OPENVINO_OP_REG(LRN, ov::op::v0)
_OPENVINO_OP_REG(LSTMCell, ov::op::v0)
-_OPENVINO_OP_REG(LSTMSequence, ov::op::v0)
_OPENVINO_OP_REG(MatMul, ov::op::v0)
_OPENVINO_OP_REG(MaxPool, ov::op::v1)
_OPENVINO_OP_REG(Maximum, ov::op::v1)
diff --git a/src/core/include/openvino/opsets/opset3.hpp b/src/core/include/openvino/opsets/opset3.hpp
index 29cd23b89c1..a4e99a21e1c 100644
--- a/src/core/include/openvino/opsets/opset3.hpp
+++ b/src/core/include/openvino/opsets/opset3.hpp
@@ -9,9 +9,7 @@
namespace ov {
namespace opset3 {
#define _OPENVINO_OP_REG(a, b) using b::a;
-OPENVINO_SUPPRESS_DEPRECATED_START
#include "openvino/opsets/opset3_tbl.hpp"
-OPENVINO_SUPPRESS_DEPRECATED_END
#undef _OPENVINO_OP_REG
} // namespace opset3
} // namespace ov
diff --git a/src/core/include/openvino/opsets/opset3_tbl.hpp b/src/core/include/openvino/opsets/opset3_tbl.hpp
index 3c34a6999f2..5c16414a02e 100644
--- a/src/core/include/openvino/opsets/opset3_tbl.hpp
+++ b/src/core/include/openvino/opsets/opset3_tbl.hpp
@@ -60,7 +60,6 @@ _OPENVINO_OP_REG(LogicalOr, ov::op::v1)
_OPENVINO_OP_REG(LogicalXor, ov::op::v1)
_OPENVINO_OP_REG(LRN, ov::op::v0)
_OPENVINO_OP_REG(LSTMCell, ov::op::v0)
-_OPENVINO_OP_REG(LSTMSequence, ov::op::v0)
_OPENVINO_OP_REG(MatMul, ov::op::v0)
_OPENVINO_OP_REG(MaxPool, ov::op::v1)
_OPENVINO_OP_REG(Maximum, ov::op::v1)
diff --git a/src/core/reference/include/openvino/reference/sequences.hpp b/src/core/reference/include/openvino/reference/sequences.hpp
index af1946fcbe7..42b4083793b 100644
--- a/src/core/reference/include/openvino/reference/sequences.hpp
+++ b/src/core/reference/include/openvino/reference/sequences.hpp
@@ -380,131 +380,6 @@ void lstm_sequence(const char* X,
}
}
-template <typename T, typename U>
-void lstm_sequence_v1(const char* X,
- const Shape& X_shape,
- const char* H,
- const Shape& H_shape,
- const char* C,
- const Shape& C_shape,
- const char* seq_lengths,
- const Shape& seq_lengths_shape,
- const char* W,
- const Shape& W_shape,
- const char* R,
- const Shape& R_shape,
- const char* B,
- const Shape& B_shape,
- const char* P,
- const Shape& P_shape,
- char* Y,
- char* Ho,
- char* Co,
- const std::string& activation_f,
- const std::string& activation_g,
- const std::string& activation_h,
- float clip,
- const ov::op::LSTMWeightsFormat weight_format,
- bool input_forget,
- op::RecurrentSequenceDirection direction) {
- OutputVector results;
- if (direction == op::RecurrentSequenceDirection::FORWARD || direction == op::RecurrentSequenceDirection::REVERSE) {
- CellArgs args;
- args.activation_f = activation_f;
- args.activation_g = activation_g;
- args.activation_h = activation_h;
- args.clip = clip;
- args.weight_format = weight_format;
- args.input_forget = input_forget;
- std::vector<const char*> inputs = {X, seq_lengths, H, C, W, R, B, P};
- std::vector<char*> outputs = {Y, Ho, Co};
- std::vector<Shape> shapes = {X_shape, seq_lengths_shape, H_shape, C_shape, W_shape, R_shape, B_shape, P_shape};
- cell_pass<T, U>(CellType::LSTM_v1,
- inputs,
- shapes,
- outputs,
- args,
- direction == op::RecurrentSequenceDirection::REVERSE);
- } else if (direction == op::RecurrentSequenceDirection::BIDIRECTIONAL) {
- // Split bidirectional case to forward + reverse passes.
- // split inputs
- std::vector<std::vector<char>> H_split(2, std::vector<char>(sizeof(T) * shape_size(H_shape) / 2));
- std::vector<std::vector<char>> C_split(2, std::vector<char>(sizeof(T) * shape_size(C_shape) / 2));
- std::vector<std::vector<char>> W_split(2, std::vector<char>(sizeof(T) * shape_size(W_shape) / 2));
- std::vector<std::vector<char>> R_split(2, std::vector<char>(sizeof(T) * shape_size(R_shape) / 2));
- std::vector<std::vector<char>> B_split(2, std::vector<char>(sizeof(T) * shape_size(B_shape) / 2));
- std::vector<std::vector<char>> P_split(2, std::vector<char>(sizeof(T) * shape_size(P_shape) / 2));
- char* h_pointers[2] = {H_split[0].data(), H_split[1].data()};
- char* c_pointers[2] = {C_split[0].data(), C_split[1].data()};
- char* w_pointers[2] = {W_split[0].data(), W_split[1].data()};
- char* r_pointers[2] = {R_split[0].data(), R_split[1].data()};
- char* b_pointers[2] = {B_split[0].data(), B_split[1].data()};
- char* p_pointers[2] = {P_split[0].data(), P_split[1].data()};
- reference::split(H, H_shape, sizeof(T), 1, 2, h_pointers);
- reference::split(C, C_shape, sizeof(T), 1, 2, c_pointers);
- reference::split(W, W_shape, sizeof(T), 0, 2, w_pointers);
- reference::split(R, R_shape, sizeof(T), 0, 2, r_pointers);
- reference::split(B, B_shape, sizeof(T), 0, 2, b_pointers);
- reference::split(P, P_shape, sizeof(T), 0, 2, p_pointers);
- std::vector<char> forward_res_y(sizeof(T) * H_shape[0] * H_shape[2] * X_shape[1]);
- std::vector<char> reverse_res_y(sizeof(T) * H_shape[0] * H_shape[2] * X_shape[1]);
- std::vector<std::vector<char>> forward_res(2, std::vector<char>(sizeof(T) * H_shape[0] * H_shape[2]));
- std::vector<std::vector<char>> reverse_res(2, std::vector<char>(sizeof(T) * H_shape[0] * H_shape[2]));
-
- CellArgs args;
- args.activation_f = activation_f;
- args.activation_g = activation_g;
- args.activation_h = activation_h;
- args.clip = clip;
- args.weight_format = weight_format;
- args.input_forget = input_forget;
- std::vector<Shape> shapes = {X_shape, seq_lengths_shape, H_shape, C_shape, W_shape, R_shape, B_shape, P_shape};
- // update H,C,W,R,B,P shapes after split
- shapes[2][1] = 1;
- shapes[3][1] = 1;
- for (size_t i = 4; i < shapes.size(); ++i) {
- shapes[i][0] = 1;
- }
- // forward pass
- cell_pass<T, U>(
- CellType::LSTM_v1,
- {X, seq_lengths, h_pointers[0], c_pointers[0], w_pointers[0], r_pointers[0], b_pointers[0], p_pointers[0]},
- shapes,
- {forward_res_y.data(), forward_res[0].data(), forward_res[1].data()},
- args,
- false);
- // reverse pass
- cell_pass<T, U>(
- CellType::LSTM_v1,
- {X, seq_lengths, h_pointers[1], c_pointers[1], w_pointers[1], r_pointers[1], b_pointers[1], p_pointers[1]},
- shapes,
- {reverse_res_y.data(), reverse_res[0].data(), reverse_res[1].data()},
- args,
- true);
-
- // Stack together respective outputs from both forward and reverse passes.
- std::vector<Shape> in_shapes_y = {{H_shape[0], 1, X_shape[1], H_shape[2]},
- {H_shape[0], 1, X_shape[1], H_shape[2]}};
- std::vector<Shape> in_shapes_h_c = {{H_shape[0], 1, H_shape[2]}, {H_shape[0], 1, H_shape[2]}};
- Shape output_shape_y{H_shape[0], 2, X_shape[1], H_shape[2]};
- Shape output_shape_h_c{H_shape[0], 2, H_shape[2]};
-
- reference::concat({forward_res_y.data(), reverse_res_y.data()}, Y, in_shapes_y, output_shape_y, 1, sizeof(T));
- reference::concat({forward_res[0].data(), reverse_res[0].data()},
- Ho,
- in_shapes_h_c,
- output_shape_h_c,
- 1,
- sizeof(T));
- reference::concat({forward_res[1].data(), reverse_res[1].data()},
- Co,
- in_shapes_h_c,
- output_shape_h_c,
- 1,
- sizeof(T));
- }
-}
-
template <typename T, typename U>
void gru_sequence(const char* X,
const Shape& X_shape,
diff --git a/src/core/shape_inference/include/lstm_sequence_shape_inference.hpp b/src/core/shape_inference/include/lstm_sequence_shape_inference.hpp
index c2b5f1389de..8b0daeb2766 100644
--- a/src/core/shape_inference/include/lstm_sequence_shape_inference.hpp
+++ b/src/core/shape_inference/include/lstm_sequence_shape_inference.hpp
@@ -7,32 +7,6 @@
namespace ov {
namespace op {
-namespace v0 {
-OPENVINO_SUPPRESS_DEPRECATED_START
-template <class TShape>
-std::vector<result_shape_t<TShape>> shape_infer(const LSTMSequence* op, const std::vector<TShape>& input_shapes) {
- OPENVINO_SUPPRESS_DEPRECATED_END
- constexpr auto num_gates = 4;
- constexpr auto num_state_nodes = 2;
- const auto output_shapes =
- rnn::seq_base_shape_infer(op, input_shapes, num_gates, num_state_nodes, op->get_direction());
- // Validate rank and dimension for P input (the input doesn't exists in the next version of LSTM or other RNN based
- // ops) The checks are compatible with the original restrictions of the v0::LSTMSequence
- const auto& hidden_size = output_shapes[0][3];
- if (input_shapes.size() > 7 && input_shapes[7].is_static() && hidden_size.is_static()) {
- const auto& p_pshape = input_shapes[7];
- NODE_VALIDATION_CHECK(op, p_pshape.rank().compatible(2), "Input tensor P should have rank equal 2.");
- NODE_VALIDATION_CHECK(op,
- p_pshape[1].compatible(hidden_size * (num_gates - 1)),
- "Inorrect shape of P input. Second dimension is: ",
- p_pshape[1],
- ", expected: ",
- hidden_size.get_length() * (num_gates - 1),
- ".");
- }
- return output_shapes;
-}
-} // namespace v0
namespace v5 {
template <class TShape>
std::vector<result_shape_t<TShape>> shape_infer(const LSTMSequence* op, const std::vector<TShape>& input_shapes) {
diff --git a/src/core/src/op/lstm_sequence.cpp b/src/core/src/op/lstm_sequence.cpp
index 4d9afa58f46..3f70b74e5ef 100644
--- a/src/core/src/op/lstm_sequence.cpp
+++ b/src/core/src/op/lstm_sequence.cpp
@@ -10,155 +10,6 @@
#include "openvino/op/util/recurrent_sequence.hpp"
namespace ov {
-OPENVINO_SUPPRESS_DEPRECATED_START
-op::v0::LSTMSequence::LSTMSequence(const Output<Node>& X,
- const Output<Node>& initial_hidden_state,
- const Output<Node>& initial_cell_state,
- const Output<Node>& sequence_lengths,
- const Output<Node>& W,
- const Output<Node>& R,
- const Output<Node>& B,
- const Output<Node>& P,
- const std::int64_t hidden_size,
- const LSTMSequence::direction lstm_direction,
- LSTMWeightsFormat weights_format,
- const std::vector<float> activations_alpha,
- const std::vector<float> activations_beta,
- const std::vector<std::string> activations,
- const float clip_threshold,
- const bool input_forget)
- : RNNCellBase({X, initial_hidden_state, initial_cell_state, sequence_lengths, W, R, B, P},
- hidden_size,
- clip_threshold,
- activations,
- activations_alpha,
- activations_beta),
- m_direction(lstm_direction),
- m_input_forget(input_forget),
- m_weights_format(weights_format) {
- constructor_validate_and_infer_types();
-}
-
-op::v0::LSTMSequence::LSTMSequence(const Output<Node>& X,
- const Output<Node>& initial_hidden_state,
- const Output<Node>& initial_cell_state,
- const Output<Node>& sequence_lengths,
- const Output<Node>& W,
- const Output<Node>& R,
- const Output<Node>& B,
- const std::int64_t hidden_size,
- const LSTMSequence::direction lstm_direction,
- LSTMWeightsFormat weights_format,
- const std::vector<float>& activations_alpha,
- const std::vector<float>& activations_beta,
- const std::vector<std::string>& activations,
- const float clip_threshold,
- const bool input_forget)
- : op::v0::LSTMSequence(
- X,
- initial_hidden_state,
- initial_cell_state,
- sequence_lengths,
- W,
- R,
- B,
- Constant::create(element::f32,
- Shape{(lstm_direction == LSTMSequence::direction::BIDIRECTIONAL ? 2UL : 1UL),
- 3UL * static_cast<size_t>(hidden_size)},
- std::vector<float>{0.f}),
- hidden_size,
- lstm_direction,
- weights_format,
- activations_alpha,
- activations_beta,
- activations,
- clip_threshold,
- input_forget) {}
-
-bool op::v0::LSTMSequence::visit_attributes(AttributeVisitor& visitor) {
- OV_OP_SCOPE(v0_LSTMSequence_visit_attributes);
- visitor.on_attribute("hidden_size", m_hidden_size);
- visitor.on_attribute("activations", m_activations);
- visitor.on_attribute("activations_alpha", m_activations_alpha);
- visitor.on_attribute("activations_beta", m_activations_beta);
- visitor.on_attribute("clip", m_clip);
- visitor.on_attribute("direction", m_direction);
-
- visitor.on_attribute("input_forget", m_input_forget);
- visitor.on_attribute("weights_format", m_weights_format);
- return true;
-}
-
-std::shared_ptr<Node> op::v0::LSTMSequence::clone_with_new_inputs(const OutputVector& new_args) const {
- OV_OP_SCOPE(v0_LSTMSequence_clone_with_new_inputs);
- check_new_args_count(this, new_args);
- if (new_args.size() == 8) {
- return std::make_shared<op::v0::LSTMSequence>(new_args.at(0), // X
- new_args.at(1), // initial_hidden_state
- new_args.at(2), // initial_cell_state
- new_args.at(3), // sequence_lengths
- new_args.at(4), // W
- new_args.at(5), // R
- new_args.at(6), // B
- new_args.at(7), // P
- m_hidden_size,
- m_direction,
- m_weights_format,
- m_activations_alpha,
- m_activations_beta,
- m_activations,
- m_clip,
- m_input_forget);
- } else if (new_args.size() == 7) {
- return std::make_shared<op::v0::LSTMSequence>(new_args.at(0), // X
- new_args.at(1), // initial_hidden_state
- new_args.at(2), // initial_cell_state
- new_args.at(3), // sequence_lengths
- new_args.at(4), // W
- new_args.at(5), // R
- new_args.at(6), // B
- m_hidden_size,
- m_direction,
- m_weights_format,
- m_activations_alpha,
- m_activations_beta,
- m_activations,
- m_clip,
- m_input_forget);
- } else {
- OPENVINO_THROW("Incorrect number of new arguments");
- }
-}
-
-void op::v0::LSTMSequence::validate_and_infer_types() {
- OV_OP_SCOPE(v0_LSTMSequence_validate_and_infer_types);
- auto result_et = element::dynamic;
-
- // Validate input types and save result for output type
- NODE_VALIDATION_CHECK(this,
- element::Type::merge(result_et, result_et, get_input_element_type(0)) &&
- element::Type::merge(result_et, result_et, get_input_element_type(1)) &&
- element::Type::merge(result_et, result_et, get_input_element_type(2)) &&
- element::Type::merge(result_et, result_et, get_input_element_type(4)) &&
- element::Type::merge(result_et, result_et, get_input_element_type(5)) &&
- element::Type::merge(result_et, result_et, get_input_element_type(6)),
- "Element types for X, initial_hidden_state, initial_cell_state, W, R and B inputs do "
- "not match.");
-
- // Mark inputs which are relevant to output parameters
- for (size_t i = 0; i <= 6; ++i)
- set_input_is_relevant_to_shape(i);
-
- const auto input_shapes = ov::util::get_node_input_partial_shapes(*this);
- auto output_shapes = shape_infer(this, input_shapes);
-
- // Set output size, type and shape
- set_output_type(0, result_et, output_shapes[0]);
- set_output_type(1, result_et, output_shapes[1]);
- set_output_type(2, result_et, output_shapes[2]);
-}
-OPENVINO_SUPPRESS_DEPRECATED_END
-
bool op::v5::LSTMSequence::visit_attributes(AttributeVisitor& visitor) {
OV_OP_SCOPE(v5_LSTMSequence_visit_attributes);
visitor.on_attribute("direction", m_direction);
diff --git a/src/core/src/pass/low_latency.cpp b/src/core/src/pass/low_latency.cpp
index 7ef4fcd5e84..4b9f606b3e4 100644
--- a/src/core/src/pass/low_latency.cpp
+++ b/src/core/src/pass/low_latency.cpp
@@ -158,26 +158,7 @@ std::vector<std::shared_ptr<ov::opset9::Assign>> process_sequence(const std::sha
std::shared_ptr<ov::Node> cell;
std::vector<std::shared_ptr<ov::opset9::Assign>> new_assigns;
bool unroll = false;
- OPENVINO_SUPPRESS_DEPRECATED_START
- if (auto lstm_seq_v0 = std::dynamic_pointer_cast<ov::opset1::LSTMSequence>(op)) {
- unroll = need_unroll(op);
- new_assigns = replace_with_memory(op, {1, 2}, m_use_const_initializer, to);
- if (unroll) {
- auto inputs = prepare_inputs(op, 3, to);
- cell = to.make<LSTMCell>(inputs[0],
- inputs[1],
- inputs[2],
- inputs[3],
- inputs[4],
- inputs[5],
- lstm_seq_v0->get_hidden_size(),
- lstm_seq_v0->get_activations(),
- lstm_seq_v0->get_activations_alpha(),
- lstm_seq_v0->get_activations_beta(),
- lstm_seq_v0->get_clip_threshold());
- }
- OPENVINO_SUPPRESS_DEPRECATED_END
- } else if (auto lstm_seq_v5 = std::dynamic_pointer_cast<LSTMSequence>(op)) {
+ if (auto lstm_seq_v5 = std::dynamic_pointer_cast<LSTMSequence>(op)) {
unroll = need_unroll(op);
new_assigns = replace_with_memory(op, {1, 2}, m_use_const_initializer, to);
if (unroll) {
diff --git a/src/core/tests/opset.cpp b/src/core/tests/opset.cpp
index 3a2a590de43..65c79dc9432 100644
--- a/src/core/tests/opset.cpp
+++ b/src/core/tests/opset.cpp
@@ -61,9 +61,9 @@ TEST_P(OpsetTests, opset_dump) {
INSTANTIATE_TEST_SUITE_P(opset,
OpsetTests,
- testing::Values(OpsetTestParams{ov::get_opset1, 110},
- OpsetTestParams{ov::get_opset2, 112},
- OpsetTestParams{ov::get_opset3, 127},
+ testing::Values(OpsetTestParams{ov::get_opset1, 109},
+ OpsetTestParams{ov::get_opset2, 111},
+ OpsetTestParams{ov::get_opset3, 126},
OpsetTestParams{ov::get_opset4, 137},
OpsetTestParams{ov::get_opset5, 145},
OpsetTestParams{ov::get_opset6, 152},
diff --git a/src/core/tests/type_prop/lstm_sequence.cpp b/src/core/tests/type_prop/lstm_sequence.cpp
index 698206e25a5..80da26340fd 100644
--- a/src/core/tests/type_prop/lstm_sequence.cpp
+++ b/src/core/tests/type_prop/lstm_sequence.cpp
@@ -89,42 +89,6 @@ shared_ptr<opset5::LSTMSequence> lstm_seq_direction_initialization(const recurre
return lstm_sequence;
}
-
-OPENVINO_SUPPRESS_DEPRECATED_START
-shared_ptr<opset1::LSTMSequence> lstm_seq_v0_tensor_initialization(const recurrent_sequence_parameters& param) {
- auto batch_size = param.batch_size;
- auto seq_length = param.seq_length;
- auto input_size = param.input_size;
- auto num_directions = param.num_directions;
- auto hidden_size = param.hidden_size;
- auto et = param.et;
-
- const auto X = make_shared<opset5::Parameter>(et, PartialShape{batch_size, seq_length, input_size});
- const auto initial_hidden_state =
- make_shared<opset5::Parameter>(et, PartialShape{batch_size, num_directions, hidden_size});
- const auto initial_cell_state =
- make_shared<opset5::Parameter>(et, PartialShape{batch_size, num_directions, hidden_size});
- const auto sequence_lengths = make_shared<opset5::Parameter>(et, PartialShape{batch_size});
- const auto W = make_shared<opset5::Parameter>(et, PartialShape{num_directions, hidden_size * 4, input_size});
- const auto R = make_shared<opset5::Parameter>(et, PartialShape{num_directions, hidden_size * 4, hidden_size});
- const auto B = make_shared<opset5::Parameter>(et, PartialShape{num_directions, hidden_size * 4});
- const auto P = make_shared<opset5::Parameter>(et, PartialShape{num_directions, hidden_size * 3});
-
- const auto lstm_sequence = make_shared<opset1::LSTMSequence>();
-
- lstm_sequence->set_argument(0, X);
- lstm_sequence->set_argument(1, initial_hidden_state);
- lstm_sequence->set_argument(2, initial_cell_state);
- lstm_sequence->set_argument(3, sequence_lengths);
- lstm_sequence->set_argument(4, W);
- lstm_sequence->set_argument(5, R);
- lstm_sequence->set_argument(6, B);
- lstm_sequence->set_argument(7, P);
-
- return lstm_sequence;
-}
-OPENVINO_SUPPRESS_DEPRECATED_END
-
} // namespace
TEST(type_prop, lstm_sequence_forward) {
@@ -173,56 +137,6 @@ TEST(type_prop, lstm_sequence_forward) {
EXPECT_EQ(lstm_sequence->get_output_shape(2), (Shape{batch_size, num_directions, hidden_size}));
}
-TEST(type_prop, lstm_sequence_v0_forward) {
- const size_t batch_size = 8;
- const size_t num_directions = 1;
- const size_t seq_length = 6;
- const size_t input_size = 4;
- const size_t hidden_size = 128;
-
- const auto X = make_shared<opset5::Parameter>(element::f32, Shape{batch_size, seq_length, input_size});
- const auto initial_hidden_state =
- make_shared<opset5::Parameter>(element::f32, Shape{batch_size, num_directions, hidden_size});
- const auto initial_cell_state =
- make_shared<opset5::Parameter>(element::f32, Shape{batch_size, num_directions, hidden_size});
- const auto sequence_lengths = make_shared<opset5::Parameter>(element::i32, Shape{batch_size});
- const auto W = make_shared<opset5::Parameter>(element::f32, Shape{num_directions, 4 * hidden_size, input_size});
- const auto R = make_shared<opset5::Parameter>(element::f32, Shape{num_directions, 4 * hidden_size, hidden_size});
- const auto B = make_shared<opset5::Parameter>(element::f32, Shape{num_directions, 4 * hidden_size});
- const auto P = make_shared<opset5::Parameter>(element::f32, Shape{num_directions, 3 * hidden_size});
-
- const auto lstm_direction = op::RecurrentSequenceDirection::FORWARD;
-
- OPENVINO_SUPPRESS_DEPRECATED_START
- const auto lstm_sequence = make_shared<opset1::LSTMSequence>(X,
- initial_hidden_state,
- initial_cell_state,
- sequence_lengths,
- W,
- R,
- B,
- P,
- hidden_size,
- lstm_direction);
-
- EXPECT_EQ(lstm_sequence->get_hidden_size(), hidden_size);
- EXPECT_EQ(lstm_sequence->get_direction(), op::RecurrentSequenceDirection::FORWARD);
- EXPECT_TRUE(lstm_sequence->get_activations_alpha().empty());
- EXPECT_TRUE(lstm_sequence->get_activations_beta().empty());
- EXPECT_EQ(lstm_sequence->get_activations()[0], "sigmoid");
- EXPECT_EQ(lstm_sequence->get_activations()[1], "tanh");
- EXPECT_EQ(lstm_sequence->get_activations()[2], "tanh");
- EXPECT_EQ(lstm_sequence->get_clip_threshold(), 0.f);
- EXPECT_EQ(lstm_sequence->get_output_element_type(0), element::f32);
- EXPECT_EQ(lstm_sequence->outputs().size(), 3);
- EXPECT_EQ(lstm_sequence->get_output_shape(0), (Shape{batch_size, num_directions, seq_length, hidden_size}));
- EXPECT_EQ(lstm_sequence->get_output_element_type(1), element::f32);
- EXPECT_EQ(lstm_sequence->get_output_shape(1), (Shape{batch_size, num_directions, hidden_size}));
- EXPECT_EQ(lstm_sequence->get_output_element_type(2), element::f32);
- EXPECT_EQ(lstm_sequence->get_output_shape(2), (Shape{batch_size, num_directions, hidden_size}));
- OPENVINO_SUPPRESS_DEPRECATED_END
-}
-
TEST(type_prop, lstm_sequence_bidirectional) {
const size_t batch_size = 24;
const size_t num_directions = 2;
@@ -273,68 +187,6 @@ TEST(type_prop, lstm_sequence_bidirectional) {
EXPECT_EQ(lstm_sequence->get_output_shape(2), (Shape{batch_size, num_directions, hidden_size}));
}
-TEST(type_prop, lstm_sequence_v0_bidirectional) {
- const size_t batch_size = 24;
- const size_t num_directions = 2;
- const size_t seq_length = 12;
- const size_t input_size = 8;
- const size_t hidden_size = 256;
- const bool input_forget = true;
- const ov::op::LSTMWeightsFormat weights_format = ov::op::LSTMWeightsFormat::FICO;
- const float clip_threshold = 3.5f;
-
- const auto X = make_shared<opset5::Parameter>(element::f32, Shape{batch_size, seq_length, input_size});
- const auto initial_hidden_state =
- make_shared<opset5::Parameter>(element::f32, Shape{batch_size, num_directions, hidden_size});
- const auto initial_cell_state =
- make_shared<opset5::Parameter>(element::f32, Shape{batch_size, num_directions, hidden_size});
- const auto sequence_lengths = make_shared<opset5::Parameter>(element::i32, Shape{batch_size});
- const auto W = make_shared<opset5::Parameter>(element::f32, Shape{num_directions, 4 * hidden_size, input_size});
- const auto R = make_shared<opset5::Parameter>(element::f32, Shape{num_directions, 4 * hidden_size, hidden_size});
- const auto B = make_shared<opset5::Parameter>(element::f32, Shape{num_directions, 4 * hidden_size});
- const auto P = make_shared<opset5::Parameter>(element::f32, Shape{num_directions, 3 * hidden_size});
-
- const auto lstm_direction = opset5::LSTMSequence::direction::BIDIRECTIONAL;
- const std::vector<float> activations_alpha = {2.7f, 7.0f, 32.367f};
- const std::vector<float> activations_beta = {0.0f, 5.49f, 6.0f};
- const std::vector<std::string> activations = {"tanh", "sigmoid", "sigmoid"};
-
- OPENVINO_SUPPRESS_DEPRECATED_START
- const auto lstm_sequence = make_shared<opset1::LSTMSequence>(X,
- initial_hidden_state,
- initial_cell_state,
- sequence_lengths,
- W,
- R,
- B,
- hidden_size,
- lstm_direction,
- weights_format,
- activations_alpha,
- activations_beta,
- activations,
- clip_threshold,
- input_forget);
-
- EXPECT_EQ(lstm_sequence->get_hidden_size(), hidden_size);
- EXPECT_EQ(lstm_sequence->get_direction(), opset5::LSTMSequence::direction::BIDIRECTIONAL);
- EXPECT_EQ(lstm_sequence->get_activations_alpha(), activations_alpha);
- EXPECT_EQ(lstm_sequence->get_activations_beta(), activations_beta);
- EXPECT_EQ(lstm_sequence->get_activations()[0], "tanh");
- EXPECT_EQ(lstm_sequence->get_activations()[1], "sigmoid");
- EXPECT_EQ(lstm_sequence->get_activations()[2], "sigmoid");
- EXPECT_EQ(lstm_sequence->get_clip_threshold(), 3.5f);
- EXPECT_EQ(lstm_sequence->get_input_forget(), true);
- EXPECT_EQ(lstm_sequence->get_weights_format(), ov::op::LSTMWeightsFormat::FICO);
- EXPECT_EQ(lstm_sequence->get_output_element_type(0), element::f32);
- EXPECT_EQ(lstm_sequence->get_output_shape(0), (Shape{batch_size, num_directions, seq_length, hidden_size}));
- EXPECT_EQ(lstm_sequence->get_output_element_type(1), element::f32);
- EXPECT_EQ(lstm_sequence->get_output_shape(1), (Shape{batch_size, num_directions, hidden_size}));
- EXPECT_EQ(lstm_sequence->get_output_element_type(2), element::f32);
- EXPECT_EQ(lstm_sequence->get_output_shape(2), (Shape{batch_size, num_directions, hidden_size}));
- OPENVINO_SUPPRESS_DEPRECATED_END
-}
-
TEST(type_prop, lstm_sequence_dynamic_batch_size) {
recurrent_sequence_parameters param;
@@ -573,214 +425,3 @@ TEST(type_prop, lstm_sequence_invalid_input_direction_num_mismatch) {
check_error(op::RecurrentSequenceDirection::FORWARD, 2);
check_error(op::RecurrentSequenceDirection::REVERSE, 2);
}
-
-OPENVINO_SUPPRESS_DEPRECATED_START
-TEST(type_prop, lstm_sequence_v0_dynamic_num_directions) {
- recurrent_sequence_parameters param;
-
- param.batch_size = 24;
- param.num_directions = Dimension::dynamic();
- param.seq_length = 12;
- param.input_size = 8;
- param.hidden_size = 256;
- param.et = element::f32;
-
- auto lstm_sequence = lstm_seq_v0_tensor_initialization(param);
- lstm_sequence->validate_and_infer_types();
-
- EXPECT_EQ(lstm_sequence->get_output_partial_shape(0),
- (PartialShape{param.batch_size, 1, param.seq_length, param.hidden_size}));
- EXPECT_EQ(lstm_sequence->get_output_partial_shape(1), (PartialShape{param.batch_size, 1, param.hidden_size}));
- EXPECT_EQ(lstm_sequence->get_output_partial_shape(2), (PartialShape{param.batch_size, 1, param.hidden_size}));
- EXPECT_EQ(lstm_sequence->get_output_element_type(0), param.et);
- EXPECT_EQ(lstm_sequence->get_output_element_type(1), param.et);
- EXPECT_EQ(lstm_sequence->get_output_element_type(2), param.et);
-}
-
-TEST(type_prop, lstm_sequence_v0_dynamic_seq_length) {
- recurrent_sequence_parameters param;
-
- param.batch_size = 24;
- param.num_directions = 1;
- param.seq_length = Dimension::dynamic();
- param.input_size = 8;
- param.hidden_size = 256;
- param.et = element::f32;
-
- auto lstm_sequence = lstm_seq_v0_tensor_initialization(param);
- lstm_sequence->validate_and_infer_types();
-
- EXPECT_EQ(lstm_sequence->get_output_partial_shape(0),
- (PartialShape{param.batch_size, param.num_directions, param.seq_length, param.hidden_size}));
- EXPECT_EQ(lstm_sequence->get_output_partial_shape(1),
- (PartialShape{param.batch_size, param.num_directions, param.hidden_size}));
- EXPECT_EQ(lstm_sequence->get_output_partial_shape(2),
- (PartialShape{param.batch_size, param.num_directions, param.hidden_size}));
- EXPECT_EQ(lstm_sequence->get_output_element_type(0), param.et);
- EXPECT_EQ(lstm_sequence->get_output_element_type(1), param.et);
- EXPECT_EQ(lstm_sequence->get_output_element_type(2), param.et);
-}
-
-TEST(type_prop, lstm_sequence_v0_dynamic_hidden_size) {
- recurrent_sequence_parameters param;
-
- param.batch_size = 24;
- param.num_directions = 1;
- param.seq_length = 12;
- param.input_size = 8;
- param.hidden_size = Dimension::dynamic();
- param.et = element::f32;
-
- auto lstm_sequence = lstm_seq_v0_tensor_initialization(param);
- lstm_sequence->validate_and_infer_types();
-
- EXPECT_EQ(lstm_sequence->get_output_partial_shape(0),
- (PartialShape{param.batch_size, param.num_directions, param.seq_length, param.hidden_size}));
- EXPECT_EQ(lstm_sequence->get_output_partial_shape(1),
- (PartialShape{param.batch_size, param.num_directions, param.hidden_size}));
- EXPECT_EQ(lstm_sequence->get_output_partial_shape(2),
- (PartialShape{param.batch_size, param.num_directions, param.hidden_size}));
- EXPECT_EQ(lstm_sequence->get_output_element_type(0), param.et);
- EXPECT_EQ(lstm_sequence->get_output_element_type(1), param.et);
- EXPECT_EQ(lstm_sequence->get_output_element_type(2), param.et);
-}
-
-TEST(type_prop, lstm_sequence_v0_dynamic_inputs) {
- recurrent_sequence_parameters param;
-
- param.batch_size = Dimension::dynamic();
- param.input_size = Dimension::dynamic();
- param.hidden_size = Dimension::dynamic();
- param.num_directions = Dimension::dynamic();
- param.seq_length = Dimension::dynamic();
- param.et = element::f32;
-
- auto lstm_sequence = lstm_seq_v0_tensor_initialization(param);
- lstm_sequence->validate_and_infer_types();
-
- EXPECT_EQ(lstm_sequence->get_output_partial_shape(0),
- (PartialShape{param.batch_size, 1, param.seq_length, param.hidden_size}));
- EXPECT_EQ(lstm_sequence->get_output_partial_shape(1), (PartialShape{param.batch_size, 1, param.hidden_size}));
- EXPECT_EQ(lstm_sequence->get_output_partial_shape(2), (PartialShape{param.batch_size, 1, param.hidden_size}));
- EXPECT_EQ(lstm_sequence->get_output_element_type(0), param.et);
- EXPECT_EQ(lstm_sequence->get_output_element_type(1), param.et);
- EXPECT_EQ(lstm_sequence->get_output_element_type(2), param.et);
-}
-
-TEST(type_prop, lstm_sequence_v0_invalid_input_dimension) {
- recurrent_sequence_parameters param;
-
- param.batch_size = 24;
- param.num_directions = 2;
- param.seq_length = 12;
- param.input_size = 8;
- param.hidden_size = 256;
- param.et = element::f32;
-
- auto lstm_sequence = lstm_seq_v0_tensor_initialization(param);
- auto invalid_rank0_tensor = make_shared<opset5::Parameter>(param.et, PartialShape{});
-
- // Validate invalid rank0 tensor for all inputs: X, initial_hidden_state, initial_cell_state W,
- // R, B
- for (size_t i = 0; i < lstm_sequence->get_input_size(); i++) {
- lstm_sequence = lstm_seq_v0_tensor_initialization(param);
- lstm_sequence->set_argument(i, invalid_rank0_tensor);
- ASSERT_THROW(lstm_sequence->validate_and_infer_types(), ov::AssertFailure)
- << "LSTMSequence node was created with invalid data.";
- }
-}
-
-TEST(type_prop, lstm_sequence_v0_input_dynamic_rank) {
- recurrent_sequence_parameters param;
- param.batch_size = 24;
- param.num_directions = 1;
- param.seq_length = 12;
- param.input_size = 8;
- param.hidden_size = 256;
- param.et = element::f32;
-
- auto op = lstm_seq_tensor_initialization(param);
- auto dynamic_tensor = make_shared<opset5::Parameter>(param.et, PartialShape::dynamic(Rank::dynamic()));
-
- for (size_t i = 0; i < op->get_input_size(); i++) {
- auto op = lstm_seq_v0_tensor_initialization(param);
- op->set_argument(i, dynamic_tensor);
- op->validate_and_infer_types();
- if (i == 0) { // X input
- EXPECT_EQ(op->get_output_partial_shape(0),
- (PartialShape{param.batch_size, param.num_directions, -1, param.hidden_size}));
- } else {
- EXPECT_EQ(op->get_output_partial_shape(0),
- (PartialShape{param.batch_size, param.num_directions, param.seq_length, param.hidden_size}));
- }
- EXPECT_EQ(op->get_output_partial_shape(1),
- (PartialShape{param.batch_size, param.num_directions, param.hidden_size}));
- EXPECT_EQ(op->get_output_partial_shape(2),
- (PartialShape{param.batch_size, param.num_directions, param.hidden_size}));
-
- EXPECT_EQ(op->get_output_element_type(0), param.et);
- EXPECT_EQ(op->get_output_element_type(1), param.et);
- }
-}
-
-TEST(type_prop, lstm_sequence_v0_invalid_input_direction) {
- recurrent_sequence_parameters param;
-
- param.batch_size = 24;
- param.num_directions = 3;
- param.seq_length = 12;
- param.input_size = 8;
- param.hidden_size = 256;
- param.et = element::f32;
-
- auto lstm_sequence = lstm_seq_v0_tensor_initialization(param);
- try {
- lstm_sequence->validate_and_infer_types();
- FAIL() << "LSTMSequence node was created with invalid data.";
- } catch (const NodeValidationFailure& error) {
- EXPECT_HAS_SUBSTRING(
- error.what(),
- std::string("Dimension `num_directions` doesn't match to other inputs or `direction` attribute"));
- }
-
- param.num_directions = 2; // 2 is also not allowed for default 'm_direction' = FORWARD
- lstm_sequence = lstm_seq_v0_tensor_initialization(param);
- try {
- lstm_sequence->validate_and_infer_types();
- FAIL() << "LSTMSequence node was created with invalid data.";
- } catch (const NodeValidationFailure& error) {
- EXPECT_HAS_SUBSTRING(
- error.what(),
- std::string("Dimension `num_directions` doesn't match to other inputs or `direction` attribute"));
- }
-}
-
-TEST(type_prop, lstm_sequence_v0_invalid_input_P) {
- recurrent_sequence_parameters param;
-
- param.batch_size = 24;
- param.num_directions = 1;
- param.seq_length = 12;
- param.input_size = 8;
- param.hidden_size = 256;
- param.et = element::f32;
-
- auto lstm_sequence = lstm_seq_v0_tensor_initialization(param);
- auto P = make_shared<op::v0::Parameter>(element::f32, PartialShape{param.hidden_size * 5});
- lstm_sequence->set_argument(7, P);
- try {
- lstm_sequence->validate_and_infer_types();
- FAIL() << "LSTMSequence node was created with invalid data.";
- } catch (const NodeValidationFailure& error) {
- EXPECT_HAS_SUBSTRING(error.what(), "Input tensor P should have rank equal 2");
- }
- P = make_shared<op::v0::Parameter>(element::f32, PartialShape{param.num_directions, param.hidden_size * 5});
- lstm_sequence->set_argument(7, P);
- try {
- lstm_sequence->validate_and_infer_types();
- FAIL() << "LSTMSequence node was created with invalid data.";
- } catch (const NodeValidationFailure& error) {
- EXPECT_HAS_SUBSTRING(error.what(), "Inorrect shape of P input. Second dimension is: 1280, expected: 768");
- }
- OPENVINO_SUPPRESS_DEPRECATED_END
-}
diff --git a/src/core/tests/type_prop/rnn_seq_base.cpp b/src/core/tests/type_prop/rnn_seq_base.cpp
index 9b3c1b7f8f2..db38622333d 100644
--- a/src/core/tests/type_prop/rnn_seq_base.cpp
+++ b/src/core/tests/type_prop/rnn_seq_base.cpp
@@ -83,11 +83,7 @@ public:
return std::make_shared<T>(X, H_t, sequence_lengths, W, R, B, p.hidden_size.get_max_length(), p.direction);
}
- OPENVINO_SUPPRESS_DEPRECATED_START
- template <
- typename T = TOp,
- typename std::enable_if<std::is_same<T, v0::LSTMSequence>::value || std::is_same<T, v5::LSTMSequence>::value,
- bool>::type = true>
+ template <typename T = TOp, typename std::enable_if<std::is_same<T, v5::LSTMSequence>::value, bool>::type = true>
std::shared_ptr<T> make_rnn_seq_based_op(RNNSeqParams& p, bool use_default_ctor = false) {
p.gates_count = 4;
p.outputs_size = 3;
@@ -109,19 +105,12 @@ public:
op->set_direction(p.direction);
op->set_hidden_size(p.hidden_size.get_max_length());
auto inputs = OutputVector{X, H_t, C_t, sequence_lengths, W, R, B};
- if (ov::is_type<v0::LSTMSequence>(op)) {
- const auto P =
- make_shared<v0::Parameter>(p.et,
- PartialShape{p.num_directions, p.hidden_size * (p.gates_count - 1)});
- inputs.push_back(P);
- }
op->set_arguments(inputs);
op->validate_and_infer_types();
return op;
}
return std::make_shared<T>(X, H_t, C_t, sequence_lengths, W, R, B, p.hidden_size.get_max_length(), p.direction);
}
- OPENVINO_SUPPRESS_DEPRECATED_END
};
TYPED_TEST_SUITE_P(RNNSeqBaseTest);
@@ -284,9 +273,7 @@ REGISTER_TYPED_TEST_SUITE_P(RNNSeqBaseTest,
interval_symbols_dims_shape_infer_REVERSE,
interval_symbols_dims_shape_infer_BIDIRECTIONAL);
-OPENVINO_SUPPRESS_DEPRECATED_START
-using RNNSeqBaseTypes = Types<op::v5::RNNSequence, op::v5::GRUSequence, op::v0::LSTMSequence, op::v5::LSTMSequence>;
-OPENVINO_SUPPRESS_DEPRECATED_END
+using RNNSeqBaseTypes = Types<op::v5::RNNSequence, op::v5::GRUSequence, op::v5::LSTMSequence>;
INSTANTIATE_TYPED_TEST_SUITE_P(type_prop, RNNSeqBaseTest, RNNSeqBaseTypes);
} // namespace rnn_seq_test
diff --git a/src/core/tests/visitors/op/lstm_sequence.cpp b/src/core/tests/visitors/op/lstm_sequence.cpp
index 0d386ba7bc4..f9819d9ae84 100644
--- a/src/core/tests/visitors/op/lstm_sequence.cpp
+++ b/src/core/tests/visitors/op/lstm_sequence.cpp
@@ -61,63 +61,3 @@ TEST(attributes, lstm_sequence_op) {
EXPECT_EQ(g_lstm_sequence->get_clip(), lstm_sequence->get_clip());
EXPECT_EQ(g_lstm_sequence->get_direction(), lstm_sequence->get_direction());
}
-
-OPENVINO_SUPPRESS_DEPRECATED_START
-TEST(attributes, lstm_sequence_v1_op) {
- NodeBuilder::opset().insert<ov::op::v0::LSTMSequence>();
-
- const size_t batch_size = 4;
- const size_t num_directions = 2;
- const size_t seq_length = 8;
- const size_t input_size = 16;
- const size_t hidden_size = 64;
-
- const auto X = make_shared<ov::op::v0::Parameter>(element::f32, Shape{batch_size, seq_length, input_size});
- const auto initial_hidden_state =
- make_shared<ov::op::v0::Parameter>(element::f32, Shape{batch_size, num_directions, hidden_size});
- const auto initial_cell_state =
- make_shared<ov::op::v0::Parameter>(element::f32, Shape{batch_size, num_directions, hidden_size});
- const auto sequence_lengths = make_shared<ov::op::v0::Parameter>(element::i32, Shape{batch_size});
- const auto W = make_shared<ov::op::v0::Parameter>(element::f32, Shape{num_directions, 4 * hidden_size, input_size});
- const auto R =
- make_shared<ov::op::v0::Parameter>(element::f32, Shape{num_directions, 4 * hidden_size, hidden_size});
- const auto B = make_shared<ov::op::v0::Parameter>(element::f32, Shape{num_directions, 4 * hidden_size});
- const auto P = make_shared<ov::op::v0::Parameter>(element::f32, Shape{num_directions, 3 * hidden_size});
-
- const auto lstm_direction = op::RecurrentSequenceDirection::BIDIRECTIONAL;
- const ov::op::LSTMWeightsFormat weights_format = ov::op::LSTMWeightsFormat::FICO;
- const std::vector<float> activations_alpha = {1, 2, 3};
- const std::vector<float> activations_beta = {4, 5, 6};
- const std::vector<std::string> activations = {"tanh", "sigmoid", "tanh"};
- const float clip_threshold = 0.5f;
- const bool input_forget = true;
-
- const auto lstm_sequence = make_shared<ov::op::v0::LSTMSequence>(X,
- initial_hidden_state,
- initial_cell_state,
- sequence_lengths,
- W,
- R,
- B,
- P,
- hidden_size,
- lstm_direction,
- weights_format,
- activations_alpha,
- activations_beta,
- activations,
- clip_threshold,
- input_forget);
- NodeBuilder builder(lstm_sequence, {X, initial_hidden_state, initial_cell_state, sequence_lengths, W, R, B, P});
- auto g_lstm_sequence = ov::as_type_ptr<ov::op::v0::LSTMSequence>(builder.create());
-
- EXPECT_EQ(g_lstm_sequence->get_hidden_size(), lstm_sequence->get_hidden_size());
- EXPECT_EQ(g_lstm_sequence->get_activations(), lstm_sequence->get_activations());
- EXPECT_EQ(g_lstm_sequence->get_activations_alpha(), lstm_sequence->get_activations_alpha());
- EXPECT_EQ(g_lstm_sequence->get_activations_beta(), lstm_sequence->get_activations_beta());
- EXPECT_EQ(g_lstm_sequence->get_clip_threshold(), lstm_sequence->get_clip_threshold());
- EXPECT_EQ(g_lstm_sequence->get_direction(), lstm_sequence->get_direction());
- EXPECT_EQ(g_lstm_sequence->get_input_forget(), lstm_sequence->get_input_forget());
- EXPECT_EQ(g_lstm_sequence->get_weights_format(), lstm_sequence->get_weights_format());
-}
-OPENVINO_SUPPRESS_DEPRECATED_END
diff --git a/src/frontends/onnx/frontend/src/op/lstm.cpp b/src/frontends/onnx/frontend/src/op/lstm.cpp
index 6b934db7d13..1c0efbbe6b9 100644
--- a/src/frontends/onnx/frontend/src/op/lstm.cpp
+++ b/src/frontends/onnx/frontend/src/op/lstm.cpp
@@ -211,41 +211,19 @@ ov::OutputVector lstm(const ov::frontend::onnx::Node& node) {
LSTMAttributes attributes{node};
std::shared_ptr<ov::Node> lstm_sequence;
- if ((input_map.at(LSTMInput::LSTM_INPUT_P).get_names() != std::unordered_set<std::string>({"P_blank"})) ||
- (attributes.m_input_forget == true)) {
- OPENVINO_SUPPRESS_DEPRECATED_START
- lstm_sequence = std::make_shared<ov::op::v0::LSTMSequence>(input_map.at(LSTMInput::LSTM_INPUT_X),
- input_map.at(LSTMInput::LSTM_INPUT_INIT_H),
- input_map.at(LSTMInput::LSTM_INPUT_INIT_C),
- input_map.at(LSTMInput::LSTM_INPUT_SEQ_LENGTHS),
- input_map.at(LSTMInput::LSTM_INPUT_W),
- input_map.at(LSTMInput::LSTM_INPUT_R),
- input_map.at(LSTMInput::LSTM_INPUT_B),
- input_map.at(LSTMInput::LSTM_INPUT_P),
- attributes.m_hidden_size,
- attributes.m_direction,
- ov::op::LSTMWeightsFormat::FICO,
- attributes.m_activation_alpha,
- attributes.m_activation_beta,
- attributes.m_activations,
- attributes.m_clip_threshold,
- attributes.m_input_forget);
- OPENVINO_SUPPRESS_DEPRECATED_END
- } else {
- lstm_sequence = std::make_shared<v5::LSTMSequence>(input_map.at(LSTMInput::LSTM_INPUT_X),
- input_map.at(LSTMInput::LSTM_INPUT_INIT_H),
- input_map.at(LSTMInput::LSTM_INPUT_INIT_C),
- input_map.at(LSTMInput::LSTM_INPUT_SEQ_LENGTHS),
- input_map.at(LSTMInput::LSTM_INPUT_W),
- input_map.at(LSTMInput::LSTM_INPUT_R),
- input_map.at(LSTMInput::LSTM_INPUT_B),
- attributes.m_hidden_size,
- attributes.m_direction,
- attributes.m_activation_alpha,
- attributes.m_activation_beta,
- attributes.m_activations,
- attributes.m_clip_threshold);
- }
+ lstm_sequence = std::make_shared<v5::LSTMSequence>(input_map.at(LSTMInput::LSTM_INPUT_X),
+ input_map.at(LSTMInput::LSTM_INPUT_INIT_H),
+ input_map.at(LSTMInput::LSTM_INPUT_INIT_C),
+ input_map.at(LSTMInput::LSTM_INPUT_SEQ_LENGTHS),
+ input_map.at(LSTMInput::LSTM_INPUT_W),
+ input_map.at(LSTMInput::LSTM_INPUT_R),
+ input_map.at(LSTMInput::LSTM_INPUT_B),
+ attributes.m_hidden_size,
+ attributes.m_direction,
+ attributes.m_activation_alpha,
+ attributes.m_activation_beta,
+ attributes.m_activations,
+ attributes.m_clip_threshold);
const auto Y = lstm_sequence->output(0);
const auto Y_h = lstm_sequence->output(1);
diff --git a/src/frontends/onnx/tests/models/lstm_bdir_short_input_seq.prototxt b/src/frontends/onnx/tests/models/lstm_bdir_short_input_seq.prototxt
deleted file mode 100644
index 57b723e44b6..00000000000
--- a/src/frontends/onnx/tests/models/lstm_bdir_short_input_seq.prototxt
+++ /dev/null
@@ -1,235 +0,0 @@
-ir_version: 5
-graph {
- node {
- input: "X"
- input: "W"
- input: "R"
- input: "B"
- input: "sequence_lens"
- input: "initial_h"
- input: "initial_c"
- input: "P"
- output: "Y"
- output: "Y_h"
- output: ""
- name: "node1"
- op_type: "LSTM"
- attribute {
- name: "direction"
- s: "bidirectional"
- type: STRING
- }
- attribute {
- name: "input_forget"
- i: 0
- type: INT
- }
- attribute {
- name: "activations"
- strings: "sigmoid"
- strings: "tanh"
- strings: "tanh"
- strings: "sigmoid"
- strings: "tanh"
- strings: "tanh"
- type: STRINGS
- }
- attribute {
- name: "hidden_size"
- i: 2
- type: INT
- }
- attribute {
- name: "clip"
- f: 9999
- type: FLOAT
- }
- doc_string: "LSTM"
- domain: ""
- }
- input {
- name: "X"
- type {
- tensor_type {
- elem_type: 1
- shape {
- dim {
- dim_value: 2
- }
- dim {
- dim_value: 1
- }
- dim {
- dim_value: 2
- }
- }
- }
- }
- }
- input {
- name: "W"
- type {
- tensor_type {
- elem_type: 1
- shape {
- dim {
- dim_value: 2
- }
- dim {
- dim_value: 8
- }
- dim {
- dim_value: 2
- }
- }
- }
- }
- }
- input {
- name: "R"
- type {
- tensor_type {
- elem_type: 1
- shape {
- dim {
- dim_value: 2
- }
- dim {
- dim_value: 8
- }
- dim {
- dim_value: 2
- }
- }
- }
- }
- }
- input {
- name: "B"
- type {
- tensor_type {
- elem_type: 1
- shape {
- dim {
- dim_value: 2
- }
- dim {
- dim_value: 16
- }
- }
- }
- }
- }
- input {
- name: "sequence_lens"
- type {
- tensor_type {
- elem_type: 6
- shape {
- dim {
- dim_value: 1
- }
- }
- }
- }
- }
- input {
- name: "initial_h"
- type {
- tensor_type {
- elem_type: 1
- shape {
- dim {
- dim_value: 2
- }
- dim {
- dim_value: 1
- }
- dim {
- dim_value: 2
- }
- }
- }
- }
- }
- input {
- name: "initial_c"
- type {
- tensor_type {
- elem_type: 1
- shape {
- dim {
- dim_value: 2
- }
- dim {
- dim_value: 1
- }
- dim {
- dim_value: 2
- }
- }
- }
- }
- }
- input {
- name: "P"
- type {
- tensor_type {
- elem_type: 1
- shape {
- dim {
- dim_value: 2
- }
- dim {
- dim_value: 6
- }
- }
- }
- }
- }
- output {
- name: "Y"
- type {
- tensor_type {
- elem_type: 1
- shape {
- dim {
- dim_value: 2
- }
- dim {
- dim_value: 2
- }
- dim {
- dim_value: 1
- }
- dim {
- dim_value: 2
- }
- }
- }
- }
- }
- output {
- name: "Y_h"
- type {
- tensor_type {
- elem_type: 1
- shape {
- dim {
- dim_value: 2
- }
- dim {
- dim_value: 1
- }
- dim {
- dim_value: 2
- }
- }
- }
- }
- }
-}
-opset_import {
- domain: ""
- version: 7
-}
diff --git a/src/frontends/onnx/tests/models/lstm_fwd_with_clip_peepholes.prototxt b/src/frontends/onnx/tests/models/lstm_fwd_with_clip_peepholes.prototxt
deleted file mode 100644
index 2a218f08924..00000000000
--- a/src/frontends/onnx/tests/models/lstm_fwd_with_clip_peepholes.prototxt
+++ /dev/null
@@ -1,191 +0,0 @@
-ir_version: 4
-producer_name: "OpenVINO ONNX Frontend"
-graph {
- node {
- input: "X"
- input: "W"
- input: "R"
- input: "B"
- input: ""
- input: ""
- input: ""
- input: "P"
- output: "Y"
- output: "Y_h"
- output: "Y_c"
- op_type: "LSTM"
- attribute {
- name: "clip"
- f: 0.10000000149011612
- type: FLOAT
- }
- attribute {
- name: "direction"
- s: "forward"
- type: STRING
- }
- attribute {
- name: "hidden_size"
- i: 2
- type: INT
- }
- attribute {
- name: "input_forget"
- i: 0
- type: INT
- }
- }
- name: "compute_graph"
- input {
- name: "X"
- type {
- tensor_type {
- elem_type: 1
- shape {
- dim {
- dim_value: 2
- }
- dim {
- dim_value: 1
- }
- dim {
- dim_value: 2
- }
- }
- }
- }
- }
- input {
- name: "W"
- type {
- tensor_type {
- elem_type: 1
- shape {
- dim {
- dim_value: 1
- }
- dim {
- dim_value: 8
- }
- dim {
- dim_value: 2
- }
- }
- }
- }
- }
- input {
- name: "R"
- type {
- tensor_type {
- elem_type: 1
- shape {
- dim {
- dim_value: 1
- }
- dim {
- dim_value: 8
- }
- dim {
- dim_value: 2
- }
- }
- }
- }
- }
- input {
- name: "B"
- type {
- tensor_type {
- elem_type: 1
- shape {
- dim {
- dim_value: 1
- }
- dim {
- dim_value: 16
- }
- }
- }
- }
- }
- input {
- name: "P"
- type {
- tensor_type {
- elem_type: 1
- shape {
- dim {
- dim_value: 1
- }
- dim {
- dim_value: 6
- }
- }
- }
- }
- }
- output {
- name: "Y"
- type {
- tensor_type {
- elem_type: 1
- shape {
- dim {
- dim_value: 2
- }
- dim {
- dim_value: 1
- }
- dim {
- dim_value: 1
- }
- dim {
- dim_value: 2
- }
- }
- }
- }
- }
- output {
- name: "Y_h"
- type {
- tensor_type {
- elem_type: 1
- shape {
- dim {
- dim_value: 1
- }
- dim {
- dim_value: 1
- }
- dim {
- dim_value: 2
- }
- }
- }
- }
- }
- output {
- name: "Y_c"
- type {
- tensor_type {
- elem_type: 1
- shape {
- dim {
- dim_value: 1
- }
- dim {
- dim_value: 1
- }
- dim {
- dim_value: 2
- }
- }
- }
- }
- }
-}
-opset_import {
- version: 7
-}
diff --git a/src/frontends/onnx/tests/onnx_import_rnn.in.cpp b/src/frontends/onnx/tests/onnx_import_rnn.in.cpp
index 5979466849d..b61fd1d36f9 100644
--- a/src/frontends/onnx/tests/onnx_import_rnn.in.cpp
+++ b/src/frontends/onnx/tests/onnx_import_rnn.in.cpp
@@ -202,72 +202,6 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_bidir_mixed_seq_const) {
test_case.run(DEFAULT_FLOAT_TOLERANCE_BITS + 1);
}
-OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_with_clip_peepholes) {
- auto model = convert_model("lstm_fwd_with_clip_peepholes.onnx");
-
- auto test_case = ov::test::TestCase(model, s_device);
- test_case.add_input<float>({-0.455351f, -0.276391f, -0.185934f, -0.269585f}); // X
- test_case.add_input<float>({-0.494659f, // W
- 0.0453352f,
- -0.487793f,
- 0.417264f,
- -0.0175329f,
- 0.489074f,
- -0.446013f,
- 0.414029f,
- -0.0091708f,
- -0.255364f,
- -0.106952f,
- -0.266717f,
- -0.0888852f,
- -0.428709f,
- -0.283349f,
- 0.208792f}); // W
- test_case.add_input<float>({0.146626f,
- -0.0620289f,
- -0.0815302f,
- 0.100482f,
- -0.219535f,
- -0.306635f,
- -0.28515f,
- -0.314112f,
- -0.228172f,
- 0.405972f,
- 0.31576f,
- 0.281487f,
- -0.394864f,
- 0.42111f,
- -0.386624f,
- -0.390225f}); // R
-
- test_case.add_input<float>({0.381619f,
- 0.0323954f,
- -0.14449f,
- 0.420804f,
- -0.258721f,
- 0.45056f,
- -0.250755f,
- 0.0967895f,
- 0.0f,
- 0.0f,
- 0.0f,
- 0.0f,
- 0.0f,
- 0.0f,
- 0.0f,
- 0.0f}); // B
- test_case.add_input<float>({0.2345f, 0.5235f, 0.4378f, 0.3475f, 0.8927f, 0.3456f}); // P
-
- test_case.add_expected_output<float>(Shape{2, 1, 1, 2},
- {-0.02280854f, 0.02744377f, -0.03516197f, 0.03875681f}); // Y_data
- test_case.add_expected_output<float>(Shape{1, 1, 2}, {-0.03516197f, 0.03875681f}); // Y_h_data
- test_case.add_expected_output<float>(Shape{1, 1, 2}, {-0.07415761f, 0.07395997f}); // Y_c_data
-
- // We have to enlarge tolerance bits to 3 - it's only one bit more than default value.
- // The discrepancies may occur at most on 7th decimal position.
- test_case.run(DEFAULT_FLOAT_TOLERANCE_BITS + 3);
-}
-
OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_mixed_seq) {
auto model = convert_model("lstm_fwd_mixed_seq.onnx");
@@ -397,50 +331,6 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_fwd_large_batch_no_clip) {
test_case.run();
}
-OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_bdir_short_input_seq_peepholes) {
- auto model = convert_model("lstm_bdir_short_input_seq.onnx");
-
- auto test_case = ov::test::TestCase(model, s_device);
-
- // X
- test_case.add_input<float>({-0.455351f, -0.276391f, -0.185934f, -0.269585f});
- // W
- test_case.add_input<float>(
- {-0.494659f, 0.0453352f, -0.487793f, 0.417264f, -0.0175329f, 0.489074f, -0.446013f, 0.414029f,
- -0.0091708f, -0.255364f, -0.106952f, -0.266717f, -0.0888852f, -0.428709f, -0.283349f, 0.208792f,
- -0.494659f, 0.0453352f, -0.487793f, 0.417264f, -0.0175329f, 0.489074f, -0.446013f, 0.414029f,
- -0.0091708f, -0.255364f, -0.106952f, -0.266717f, -0.0888852f, -0.428709f, -0.283349f, 0.208792f});
- // R
- test_case.add_input<float>({0.146626f, -0.0620289f, -0.0815302f, 0.100482f, -0.219535f, -0.306635f, -0.28515f,
- -0.314112f, -0.228172f, 0.405972f, 0.31576f, 0.281487f, -0.394864f, 0.42111f,
- -0.386624f, -0.390225f, 0.146626f, -0.0620289f, -0.0815302f, 0.100482f, -0.219535f,
- -0.306635f, -0.28515f, -0.314112f, -0.228172f, 0.405972f, 0.31576f, 0.281487f,
- -0.394864f, 0.42111f, -0.386624f, -0.390225f});
- // B
- test_case.add_input<float>({0.381619f, 0.0323954f, -0.14449f, 0.420804f, -0.258721f, 0.45056f, -0.250755f,
- 0.0967895f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
- 0.0f, 0.0f, 0.381619f, 0.0323954f, -0.14449f, 0.420804f, -0.258721f,
- 0.45056f, -0.250755f, 0.0967895f, 0.0f, 0.0f, 0.0f, 0.0f,
- 0.0f, 0.0f, 0.0f, 0.0f});
- // sequence_lens
- test_case.add_input<int>({1});
- // initial_h
- test_case.add_input<float>({0.0f, 0.0f, -0.0306872f, 0.028035f});
- // initial_c
- test_case.add_input<float>({0.0f, 0.0f, -0.07243599f, 0.0467052f});
- // P
- test_case.add_input<float>(
- {0.2345f, 0.5235f, 0.4378f, 0.3475f, 0.8927f, 0.3456f, 0.2345f, 0.5235f, 0.4378f, 0.3475f, 0.8927f, 0.3456f});
-
- // Y
- test_case.add_expected_output<float>(Shape{2, 2, 1, 2},
- {-0.0251062f, 0.0561262f, -0.0318928f, 0.0762679f, 0.0f, 0.0f, 0.0f, 0.0f});
- // Y_h
- test_case.add_expected_output<float>(Shape{2, 1, 2}, {-0.0251062f, 0.0561262f, -0.0318928f, 0.0762679f});
-
- test_case.run(DEFAULT_FLOAT_TOLERANCE_BITS + 3);
-}
-
OPENVINO_TEST(${BACKEND_NAME}, onnx_model_lstm_mixed_seq_reverse) {
auto model = convert_model("lstm_mixed_seq_reverse.onnx");
diff --git a/src/frontends/onnx/tests/runtime/ie/unit_test.manifest b/src/frontends/onnx/tests/runtime/ie/unit_test.manifest
index b2e87a2588e..3eadb698ca0 100644
--- a/src/frontends/onnx/tests/runtime/ie/unit_test.manifest
+++ b/src/frontends/onnx/tests/runtime/ie/unit_test.manifest
@@ -121,9 +121,6 @@ onnx_model_lp_norm_default_dynamic
onnx_instance_normalization_dynamic
# Legacy tests with unsupported features from opset4 LSTM/GRU/RNN
-# Peepholes input unsupported
-onnx_model_lstm_fwd_with_clip_peepholes
-onnx_model_lstm_bdir_short_input_seq_peepholes
# Activation function hardsigmoid is not supported
onnx_model_gru_fwd_activations_relu_hardsigmoid
onnx_model_lstm_fwd_hardsigmoid_activation
diff --git a/src/plugins/intel_cpu/src/nodes/rnn.cpp b/src/plugins/intel_cpu/src/nodes/rnn.cpp
index cab8bb3ad46..679907c2d9c 100644
--- a/src/plugins/intel_cpu/src/nodes/rnn.cpp
+++ b/src/plugins/intel_cpu/src/nodes/rnn.cpp
@@ -33,8 +33,6 @@ static rnn_direction ieDirection2dnnl(const std::shared_ptr<const ov::Node>& op)
ov::op::RecurrentSequenceDirection direction = ov::op::RecurrentSequenceDirection::FORWARD;
if (ov::is_type<ov::op::v5::GRUSequence>(op)) {
direction = ov::as_type_ptr<const ov::op::v5::GRUSequence>(op)->get_direction();
- } else if (ov::is_type<ov::op::v0::LSTMSequence>(op)) {
- direction = ov::as_type_ptr<const ov::op::v0::LSTMSequence>(op)->get_direction();
} else if (ov::is_type<ov::op::v5::LSTMSequence>(op)) {
direction = ov::as_type_ptr<const ov::op::v5::LSTMSequence>(op)->get_direction();
} else if (ov::is_type<ov::op::v5::RNNSequence>(op)) {
@@ -75,14 +73,13 @@ static dnnl::algorithm ie2dnnl(const std::shared_ptr<const ov::Node>& op) {
else
return dnnl::algorithm::vanilla_augru;
} else if (one_of(op->get_type_info(),
- ov::op::v0::LSTMCell::get_type_info_static(),
- ov::op::v4::LSTMCell::get_type_info_static(),
- ov::op::v0::LSTMSequence::get_type_info_static(),
- ov::op::v5::LSTMSequence::get_type_info_static())) {
+ ov::op::v0::LSTMCell::get_type_info_static(),
+ ov::op::v4::LSTMCell::get_type_info_static(),
+ ov::op::v5::LSTMSequence::get_type_info_static())) {
return dnnl::algorithm::vanilla_lstm;
} else if (one_of(op->get_type_info(),
- ov::op::v0::RNNCell::get_type_info_static(),
- ov::op::v5::RNNSequence::get_type_info_static())) {
+ ov::op::v0::RNNCell::get_type_info_static(),
+ ov::op::v5::RNNSequence::get_type_info_static())) {
return dnnl::algorithm::vanilla_rnn;
} else {
OPENVINO_THROW("Operation ",
@@ -201,16 +198,15 @@ bool RNNKey::operator==(const RNNKey& rhs) const {
bool RNN::isSupportedOperation(const std::shared_ptr<const ov::Node>& op, std::string& errorMessage) noexcept {
try {
if (!one_of(op->get_type_info(),
- ov::op::v3::GRUCell::get_type_info_static(),
- ov::op::internal::AUGRUCell::get_type_info_static(),
- ov::op::internal::AUGRUSequence::get_type_info_static(),
- ov::op::v0::LSTMCell::get_type_info_static(),
- ov::op::v4::LSTMCell::get_type_info_static(),
- ov::op::v0::RNNCell::get_type_info_static(),
- ov::op::v5::GRUSequence::get_type_info_static(),
- ov::op::v0::LSTMSequence::get_type_info_static(),
- ov::op::v5::LSTMSequence::get_type_info_static(),
- ov::op::v5::RNNSequence::get_type_info_static())) {
+ ov::op::v3::GRUCell::get_type_info_static(),
+ ov::op::internal::AUGRUCell::get_type_info_static(),
+ ov::op::internal::AUGRUSequence::get_type_info_static(),
+ ov::op::v0::LSTMCell::get_type_info_static(),
+ ov::op::v4::LSTMCell::get_type_info_static(),
+ ov::op::v0::RNNCell::get_type_info_static(),
+ ov::op::v5::GRUSequence::get_type_info_static(),
+ ov::op::v5::LSTMSequence::get_type_info_static(),
+ ov::op::v5::RNNSequence::get_type_info_static())) {
errorMessage = "Unsupported sequence operation.";
return false;
}
@@ -239,9 +235,7 @@ bool RNN::isSupportedOperation(const std::shared_ptr<const ov::Node>& op, std::s
errorMessage = "Node expects 6 inputs. Actual: " + std::to_string(op->get_input_size());
return false;
}
- } else if (one_of(op->get_type_info(),
- ov::op::v0::LSTMSequence::get_type_info_static(),
- ov::op::v5::LSTMSequence::get_type_info_static())) {
+ } else if (one_of(op->get_type_info(), ov::op::v5::LSTMSequence::get_type_info_static())) {
if (op->get_input_size() != 7) {
errorMessage = "Node expects 7 inputs. Actual: " + std::to_string(op->get_input_size());
return false;
@@ -264,7 +258,6 @@ bool RNN::isSupportedOperation(const std::shared_ptr<const ov::Node>& op, std::s
if (one_of(rnnCellBase->get_type_info(),
ov::op::v0::LSTMCell::get_type_info_static(),
ov::op::v4::LSTMCell::get_type_info_static(),
- ov::op::v0::LSTMSequence::get_type_info_static(),
ov::op::v5::LSTMSequence::get_type_info_static())) {
if (rnnCellBase->get_activations() != std::vector<std::string>{"sigmoid", "tanh", "tanh"}) {
errorMessage = "Not supported activation functions";
@@ -294,9 +287,6 @@ bool RNN::isSupportedOperation(const std::shared_ptr<const ov::Node>& op, std::s
if (auto gru_seq = ov::as_type_ptr<const ov::op::v5::GRUSequence>(op)) {
direction = gru_seq->get_direction();
seqLenIdx = 2;
- } else if (auto lstm_seq = ov::as_type_ptr<const ov::op::v0::LSTMSequence>(op)) {
- direction = lstm_seq->get_direction();
- seqLenIdx = 3;
} else if (auto lstm_seq = ov::as_type_ptr<const ov::op::v5::LSTMSequence>(op)) {
direction = lstm_seq->get_direction();
seqLenIdx = 3;
@@ -441,9 +431,7 @@ RNN::RNN(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr context)
} else if (op->get_type_info() == ov::op::internal::AUGRUSequence::get_type_info_static()) {
sIdx = 2; wIdx = 3; rIdx = 4; bIdx = 5; aIdx = 6;
yIdx = 0; hoIdx = 1;
- } else if (one_of(op->get_type_info(),
- ov::op::v0::LSTMSequence::get_type_info_static(),
- ov::op::v5::LSTMSequence::get_type_info_static())) {
+ } else if (one_of(op->get_type_info(), ov::op::v5::LSTMSequence::get_type_info_static())) {
sIdx = 3; wIdx = 4; rIdx = 5; bIdx = 6;
yIdx = 0; hoIdx = 1; coIdx = 2;
}
diff --git a/src/plugins/intel_cpu/src/shape_inference/shape_inference.cpp b/src/plugins/intel_cpu/src/shape_inference/shape_inference.cpp
index 1921169f83a..8e2e794eacc 100644
--- a/src/plugins/intel_cpu/src/shape_inference/shape_inference.cpp
+++ b/src/plugins/intel_cpu/src/shape_inference/shape_inference.cpp
@@ -532,7 +532,6 @@ const IStaticShapeInferFactory::TRegistry IStaticShapeInferFactory::registry{
_OV_OP_SHAPE_INFER_MASK_REG(opset1::GroupConvolutionBackpropData, ShapeInferPaddingTA, util::bit::mask(2)),
_OV_OP_SHAPE_INFER_MASK_REG(opset1::Interpolate, ShapeInferTA, util::bit::mask(1)),
_OV_OP_SHAPE_INFER_MASK_REG(opset1::LSTMCell, ShapeInferTA, util::bit::mask()),
- _OV_OP_SHAPE_INFER_MASK_REG(opset1::LSTMSequence, ShapeInferTA, util::bit::mask()),
_OV_OP_SHAPE_INFER_MASK_REG(opset1::MatMul, ShapeInferTA, util::bit::mask()),
_OV_OP_SHAPE_INFER_MASK_REG(opset1::MaxPool, ShapeInferPaddingTA, util::bit::mask()),
_OV_OP_SHAPE_INFER_MASK_REG(opset1::NonMaxSuppression, ShapeInferTA, util::bit::mask(2)),
diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/rnn_sequences_optimization.cpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/rnn_sequences_optimization.cpp
index 72ca09a8152..916e7b21ffa 100644
--- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/rnn_sequences_optimization.cpp
+++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/rnn_sequences_optimization.cpp
@@ -124,14 +124,12 @@ ov::intel_cpu::OptimizeRNNSequenceTransposes::OptimizeRNNSequenceTransposes() {
ov::intel_cpu::OptimizeLSTMSequenceTransposes::OptimizeLSTMSequenceTransposes() {
MATCHER_SCOPE(OptimizeLSTMSequenceTransposes);
- auto lstmSequenceNgraph = ov::pass::pattern::wrap_type<ov::opset1::LSTMSequence, ov::opset5::LSTMSequence>();
+ auto lstmSequenceNgraph = ov::pass::pattern::wrap_type<ov::opset5::LSTMSequence>();
ov::matcher_pass_callback callback = [](ov::pass::pattern::Matcher &m) {
auto checkSequence = [](const std::shared_ptr<ov::Node>& node) {
if (auto lstm5 = ov::as_type_ptr<ov::opset5::LSTMSequence>(node)) {
return lstm5->get_direction() != ov::op::RecurrentSequenceDirection::BIDIRECTIONAL;
- } else if (auto lstm1 = ov::as_type_ptr<ov::opset1::LSTMSequence>(node)) {
- return lstm1->get_direction() != ov::op::RecurrentSequenceDirection::BIDIRECTIONAL;
} else {
return false;
}
diff --git a/src/plugins/intel_cpu/tests/unit/shape_inference_test/lstm_seq_shape_inference_test.cpp b/src/plugins/intel_cpu/tests/unit/shape_inference_test/lstm_seq_shape_inference_test.cpp
index 067477e146f..a8b4160f405 100644
--- a/src/plugins/intel_cpu/tests/unit/shape_inference_test/lstm_seq_shape_inference_test.cpp
+++ b/src/plugins/intel_cpu/tests/unit/shape_inference_test/lstm_seq_shape_inference_test.cpp
@@ -9,184 +9,6 @@
using namespace ov;
using namespace ov::intel_cpu;
-class LSTMSequenceV0StaticShapeInferenceTest : public OpStaticShapeInferenceTest<op::v0::LSTMSequence> {
-protected:
- void SetUp() override {
- this->output_shapes = ShapeVector(3);
- }
-};
-
-TEST_F(LSTMSequenceV0StaticShapeInferenceTest, default_ctor) {
- constexpr size_t batch_size = 2;
- constexpr size_t input_size = 3;
- constexpr size_t hidden_size = 5;
- constexpr size_t seq_len = 4;
- constexpr size_t num_directions = 1;
- constexpr size_t gates_count = 4;
-
- const auto op = make_op();
-
- input_shapes = {StaticShape{batch_size, seq_len, input_size}, // X
- StaticShape{batch_size, num_directions, hidden_size}, // H_t
- StaticShape{batch_size, num_directions, hidden_size}, // C_t
- StaticShape{batch_size}, // seq_lengths
- StaticShape{num_directions, gates_count * hidden_size, input_size}, // W
- StaticShape{num_directions, gates_count * hidden_size, hidden_size}, // R
- StaticShape{num_directions, gates_count * hidden_size}, // B
- StaticShape{num_directions, (gates_count - 1) * hidden_size}}; // P
-
- output_shapes = shape_inference(op.get(), input_shapes);
-
- EXPECT_EQ(output_shapes.size(), 3);
- EXPECT_EQ(output_shapes[0], StaticShape({batch_size, num_directions, seq_len, hidden_size}));
- EXPECT_EQ(output_shapes[1], StaticShape({batch_size, num_directions, hidden_size}));
- EXPECT_EQ(output_shapes[2], StaticShape({batch_size, num_directions, hidden_size}));
-}
-
-TEST_F(LSTMSequenceV0StaticShapeInferenceTest, FORWARD_without_P) {
- constexpr size_t batch_size = 2;
- constexpr size_t input_size = 3;
- constexpr size_t hidden_size = 5;
- constexpr size_t seq_len = 4;
- constexpr size_t num_directions = 1;
- constexpr size_t gates_count = 4;
-
- constexpr auto direction = op::RecurrentSequenceDirection::FORWARD;
-
- const auto X = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(3));
- const auto H_t = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(3));
- const auto C_t = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(3));
- const auto seq_lengths = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(1));
- const auto W = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(3));
- const auto R = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(3));
- const auto B = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(2));
-
- const auto op = make_op(X, H_t, C_t, seq_lengths, W, R, B, hidden_size, direction);
-
- input_shapes = {StaticShape{batch_size, seq_len, input_size}, // X
- StaticShape{batch_size, num_directions, hidden_size}, // H_t
- StaticShape{batch_size, num_directions, hidden_size}, // C_t
- StaticShape{batch_size}, // seq_lengths
- StaticShape{num_directions, gates_count * hidden_size, input_size}, // W
- StaticShape{num_directions, gates_count * hidden_size, hidden_size}, // R
- StaticShape{num_directions, gates_count * hidden_size}}; // B
-
- output_shapes = shape_inference(op.get(), input_shapes);
-
- EXPECT_EQ(output_shapes.size(), 3);
- EXPECT_EQ(output_shapes[0], StaticShape({batch_size, num_directions, seq_len, hidden_size}));
- EXPECT_EQ(output_shapes[1], StaticShape({batch_size, num_directions, hidden_size}));
- EXPECT_EQ(output_shapes[2], StaticShape({batch_size, num_directions, hidden_size}));
-}
-
-TEST_F(LSTMSequenceV0StaticShapeInferenceTest, FORWARD_with_P) {
- constexpr size_t batch_size = 2;
- constexpr size_t input_size = 3;
- constexpr size_t hidden_size = 5;
- constexpr size_t seq_len = 4;
- constexpr size_t num_directions = 1;
- constexpr size_t gates_count = 4;
-
- constexpr auto direction = op::RecurrentSequenceDirection::FORWARD;
-
- const auto X = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(3));
- const auto H_t = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(3));
- const auto C_t = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(3));
- const auto seq_lengths = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(1));
- const auto W = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(3));
- const auto R = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(3));
- const auto B = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(2));
- const auto P = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(2));
-
- const auto op = make_op(X, H_t, C_t, seq_lengths, W, R, B, P, hidden_size, direction);
-
- input_shapes = {StaticShape{batch_size, seq_len, input_size}, // X
- StaticShape{batch_size, num_directions, hidden_size}, // H_t
- StaticShape{batch_size, num_directions, hidden_size}, // C_t
- StaticShape{batch_size}, // seq_lengths
- StaticShape{num_directions, gates_count * hidden_size, input_size}, // W
- StaticShape{num_directions, gates_count * hidden_size, hidden_size}, // R
- StaticShape{num_directions, gates_count * hidden_size}, // B
- StaticShape{num_directions, (gates_count - 1) * hidden_size}}; // P
-
- output_shapes = shape_inference(op.get(), input_shapes);
-
- EXPECT_EQ(output_shapes.size(), 3);
- EXPECT_EQ(output_shapes[0], StaticShape({batch_size, num_directions, seq_len, hidden_size}));
- EXPECT_EQ(output_shapes[1], StaticShape({batch_size, num_directions, hidden_size}));
- EXPECT_EQ(output_shapes[2], StaticShape({batch_size, num_directions, hidden_size}));
-}
-
-TEST_F(LSTMSequenceV0StaticShapeInferenceTest, REVERSE) {
- constexpr size_t batch_size = 2;
- constexpr size_t input_size = 3;
- constexpr size_t hidden_size = 5;
- constexpr size_t seq_len = 4;
- constexpr size_t num_directions = 1;
- constexpr size_t gates_count = 4;
-
- constexpr auto direction = op::RecurrentSequenceDirection::REVERSE;
-
- const auto X = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(3));
- const auto H_t = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(3));
- const auto C_t = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(3));
- const auto seq_lengths = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(1));
- const auto W = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(3));
- const auto R = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(3));
- const auto B = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(2));
-
- const auto op = make_op(X, H_t, C_t, seq_lengths, W, R, B, hidden_size, direction);
-
- input_shapes = {StaticShape{batch_size, seq_len, input_size}, // X
- StaticShape{batch_size, num_directions, hidden_size}, // H_t
- StaticShape{batch_size, num_directions, hidden_size}, // C_t
- StaticShape{batch_size}, // seq_lengths
- StaticShape{num_directions, gates_count * hidden_size, input_size}, // W
- StaticShape{num_directions, gates_count * hidden_size, hidden_size}, // R
- StaticShape{num_directions, gates_count * hidden_size}}; // B
-
- output_shapes = shape_inference(op.get(), input_shapes);
- EXPECT_EQ(output_shapes.size(), 3);
- EXPECT_EQ(output_shapes[0], StaticShape({batch_size, num_directions, seq_len, hidden_size}));
- EXPECT_EQ(output_shapes[1], StaticShape({batch_size, num_directions, hidden_size}));
- EXPECT_EQ(output_shapes[2], StaticShape({batch_size, num_directions, hidden_size}));
-}
-
-TEST_F(LSTMSequenceV0StaticShapeInferenceTest, BIDIRECTIONAL) {
- constexpr size_t batch_size = 2;
- constexpr size_t input_size = 3;
- constexpr size_t hidden_size = 5;
- constexpr size_t seq_len = 4;
- constexpr size_t num_directions = 2;
- constexpr size_t gates_count = 4;
-
- constexpr auto direction = op::RecurrentSequenceDirection::BIDIRECTIONAL;
-
- const auto X = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(3));
- const auto H_t = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(3));
- const auto C_t = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(3));
- const auto seq_lengths = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(1));
- const auto W = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(3));
- const auto R = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(3));
- const auto B = std::make_shared<op::v0::Parameter>(element::f32, PartialShape::dynamic(2));
-
- const auto op = make_op(X, H_t, C_t, seq_lengths, W, R, B, hidden_size, direction);
-
- input_shapes = {StaticShape{batch_size, seq_len, input_size}, // X
- StaticShape{batch_size, num_directions, hidden_size}, // H_t
- StaticShape{batch_size, num_directions, hidden_size}, // C_t
- StaticShape{batch_size}, // seq_lengths
- StaticShape{num_directions, gates_count * hidden_size, input_size}, // W
- StaticShape{num_directions, gates_count * hidden_size, hidden_size}, // R
- StaticShape{num_directions, gates_count * hidden_size}}; // B
-
- output_shapes = shape_inference(op.get(), input_shapes);
- EXPECT_EQ(output_shapes.size(), 3);
- EXPECT_EQ(output_shapes[0], StaticShape({batch_size, num_directions, seq_len, hidden_size}));
- EXPECT_EQ(output_shapes[1], StaticShape({batch_size, num_directions, hidden_size}));
- EXPECT_EQ(output_shapes[2], StaticShape({batch_size, num_directions, hidden_size}));
-}
-
class LSTMSequenceV5StaticShapeInferenceTest : public OpStaticShapeInferenceTest<op::v5::LSTMSequence> {
protected:
void SetUp() override {
diff --git a/src/plugins/template/backend/evaluates_map.cpp b/src/plugins/template/backend/evaluates_map.cpp
index 134decae3ba..3c9e008ccb5 100644
--- a/src/plugins/template/backend/evaluates_map.cpp
+++ b/src/plugins/template/backend/evaluates_map.cpp
@@ -105,7 +105,6 @@ std::vector<int64_t> get_signal_size(const ov::TensorVector& inputs, size_t num_
}
ov::runtime::interpreter::EvaluatorsMap& ov::runtime::interpreter::get_evaluators_map() {
- OPENVINO_SUPPRESS_DEPRECATED_START
static runtime::interpreter::EvaluatorsMap evaluatorsMap{
#define _OPENVINO_OP_REG(NAME, NAMESPACE) {NAMESPACE::NAME::get_type_info_static(), evaluate_node<NAMESPACE::NAME>},
@@ -113,6 +112,5 @@ ov::runtime::interpreter::EvaluatorsMap& ov::runtime::interpreter::get_evaluator
#undef _OPENVINO_OP_REG
};
- OPENVINO_SUPPRESS_DEPRECATED_END
return evaluatorsMap;
}
diff --git a/src/plugins/template/backend/ops/ops_evaluates.hpp b/src/plugins/template/backend/ops/ops_evaluates.hpp
index 54d2e0cb7c8..e63c7aa8b4f 100644
--- a/src/plugins/template/backend/ops/ops_evaluates.hpp
+++ b/src/plugins/template/backend/ops/ops_evaluates.hpp
@@ -77,12 +77,6 @@ extern template bool evaluate_node<ov::op::v1::ReduceMean>(std::shared_ptr<ov::N
ov::TensorVector& outputs,
const ov::TensorVector& inputs);
-OPENVINO_SUPPRESS_DEPRECATED_START
-extern template bool evaluate_node<ov::op::v0::LSTMSequence>(std::shared_ptr<ov::Node> node,
- ov::TensorVector& outputs,
- const ov::TensorVector& inputs);
-OPENVINO_SUPPRESS_DEPRECATED_END
-
extern template bool evaluate_node<ov::op::v0::MVN>(std::shared_ptr<ov::Node> node,
ov::TensorVector& outputs,
const ov::TensorVector& inputs);
@@ -555,4 +549,4 @@ extern template bool evaluate_node<ov::op::v15::StringTensorPack>(std::shared_pt
extern template bool evaluate_node<ov::op::v15::SearchSorted>(std::shared_ptr<ov::Node> node,
ov::TensorVector& outputs,
- const ov::TensorVector& inputs);
\ No newline at end of file
+ const ov::TensorVector& inputs);
diff --git a/src/plugins/template/backend/ops/sequences.cpp b/src/plugins/template/backend/ops/sequences.cpp
index 633ec5bcab3..c8e57c846c8 100644
--- a/src/plugins/template/backend/ops/sequences.cpp
+++ b/src/plugins/template/backend/ops/sequences.cpp
@@ -54,44 +54,6 @@ bool evaluate(const std::shared_ptr<ov::op::v5::RNNSequence>& op,
return true;
}
-namespace lstm_seq_v1 {
-OPENVINO_SUPPRESS_DEPRECATED_START
-template <ov::element::Type_t t1, ov::element::Type_t t2>
-inline void evaluate(const std::shared_ptr<ov::op::v0::LSTMSequence>& op,
- ov::TensorVector& outputs,
- const ov::TensorVector& inputs) {
- OPENVINO_SUPPRESS_DEPRECATED_END
- using T1 = typename ov::element_type_traits<t1>::value_type;
- using T2 = typename ov::element_type_traits<t2>::value_type;
- ov::reference::lstm_sequence_v1<T1, T2>(static_cast<char*>(inputs[0].data()),
- inputs[0].get_shape(),
- static_cast<char*>(inputs[1].data()),
- inputs[1].get_shape(),
- static_cast<char*>(inputs[2].data()),
- inputs[2].get_shape(),
- static_cast<char*>(inputs[3].data()),
- inputs[3].get_shape(),
- static_cast<char*>(inputs[4].data()),
- inputs[4].get_shape(),
- static_cast<char*>(inputs[5].data()),
- inputs[5].get_shape(),
- static_cast<char*>(inputs[6].data()),
- inputs[6].get_shape(),
- static_cast<char*>(inputs[7].data()),
- inputs[7].get_shape(),
- static_cast<char*>(outputs[0].data()),
- static_cast<char*>(outputs[1].data()),
- static_cast<char*>(outputs[2].data()),
- op->get_activations()[0],
- op->get_activations()[1],
- op->get_activations()[2],
- op->get_clip_threshold(),
- op->get_weights_format(),
- op->get_input_forget(),
- op->get_direction());
-}
-} // namespace lstm_seq_v1
-
namespace lstm_seq_v5 {
template <ov::element::Type_t t1, ov::element::Type_t t2>
inline void evaluate(const std::shared_ptr<ov::op::v5::LSTMSequence>& op,
@@ -124,27 +86,6 @@ inline void evaluate(const std::shared_ptr<ov::op::v5::LSTMSequence>& op,
}
} // namespace lstm_seq_v5
-OPENVINO_SUPPRESS_DEPRECATED_START
-template <ov::element::Type_t ET>
-bool evaluate(const std::shared_ptr<ov::op::v0::LSTMSequence>& op,
- ov::TensorVector& outputs,
- const ov::TensorVector& inputs) {
- OPENVINO_SUPPRESS_DEPRECATED_END
- switch (inputs[3].get_element_type()) {
- case ov::element::i64:
- case ov::element::u64:
- lstm_seq_v1::evaluate<ET, ov::element::i64>(op, outputs, inputs);
- break;
- case ov::element::i32:
- case ov::element::u32:
- lstm_seq_v1::evaluate<ET, ov::element::i32>(op, outputs, inputs);
- break;
- default:
- return false;
- }
- return true;
-}
-
template <ov::element::Type_t ET>
bool evaluate(const std::shared_ptr<ov::op::v5::LSTMSequence>& op,
ov::TensorVector& outputs,
@@ -402,55 +343,6 @@ bool evaluate_node<ov::op::v5::LSTMSequence>(std::shared_ptr<ov::Node> node,
}
}
-OPENVINO_SUPPRESS_DEPRECATED_START
-template <>
-bool evaluate_node<ov::op::v0::LSTMSequence>(std::shared_ptr<ov::Node> node,
- ov::TensorVector& outputs,
- const ov::TensorVector& inputs) {
- auto element_type = node->get_output_element_type(0);
- if (ov::is_type<ov::op::v1::Select>(node) || ov::is_type<ov::op::util::BinaryElementwiseComparison>(node))
- element_type = node->get_input_element_type(1);
-
- switch (element_type) {
- case ov::element::boolean:
- return evaluate<ov::element::boolean>(ov::as_type_ptr<ov::op::v0::LSTMSequence>(node), outputs, inputs);
- case ov::element::bf16:
- return evaluate<ov::element::bf16>(ov::as_type_ptr<ov::op::v0::LSTMSequence>(node), outputs, inputs);
- case ov::element::f16:
- return evaluate<ov::element::f16>(ov::as_type_ptr<ov::op::v0::LSTMSequence>(node), outputs, inputs);
- case ov::element::f64:
- return evaluate<ov::element::f64>(ov::as_type_ptr<ov::op::v0::LSTMSequence>(node), outputs, inputs);
- case ov::element::f32:
- return evaluate<ov::element::f32>(ov::as_type_ptr<ov::op::v0::LSTMSequence>(node), outputs, inputs);
- case ov::element::i4:
- return evaluate<ov::element::i4>(ov::as_type_ptr<ov::op::v0::LSTMSequence>(node), outputs, inputs);
- case ov::element::i8:
- return evaluate<ov::element::i8>(ov::as_type_ptr<ov::op::v0::LSTMSequence>(node), outputs, inputs);
- case ov::element::i16:
- return evaluate<ov::element::i16>(ov::as_type_ptr<ov::op::v0::LSTMSequence>(node), outputs, inputs);
- case ov::element::i32:
- return evaluate<ov::element::i32>(ov::as_type_ptr<ov::op::v0::LSTMSequence>(node), outputs, inputs);
- case ov::element::i64:
- return evaluate<ov::element::i64>(ov::as_type_ptr<ov::op::v0::LSTMSequence>(node), outputs, inputs);
- case ov::element::u1:
- return evaluate<ov::element::u1>(ov::as_type_ptr<ov::op::v0::LSTMSequence>(node), outputs, inputs);
- case ov::element::u4:
- return evaluate<ov::element::u4>(ov::as_type_ptr<ov::op::v0::LSTMSequence>(node), outputs, inputs);
- case ov::element::u8:
- return evaluate<ov::element::u8>(ov::as_type_ptr<ov::op::v0::LSTMSequence>(node), outputs, inputs);
- case ov::element::u16:
- return evaluate<ov::element::u16>(ov::as_type_ptr<ov::op::v0::LSTMSequence>(node), outputs, inputs);
- case ov::element::u32:
- return evaluate<ov::element::u32>(ov::as_type_ptr<ov::op::v0::LSTMSequence>(node), outputs, inputs);
- case ov::element::u64:
- return evaluate<ov::element::u64>(ov::as_type_ptr<ov::op::v0::LSTMSequence>(node), outputs, inputs);
- default:
- OPENVINO_THROW(std::string("Unhandled data type ") + node->get_element_type().get_type_name() +
- std::string("in evaluate_node()"));
- }
-}
-OPENVINO_SUPPRESS_DEPRECATED_END
-
template <>
bool evaluate_node<ov::op::v5::RNNSequence>(std::shared_ptr<ov::Node> node,
ov::TensorVector& outputs,
diff --git a/src/plugins/template/backend/opset_int_tbl.hpp b/src/plugins/template/backend/opset_int_tbl.hpp
index 5f4e5737fcb..42dfa279703 100644
--- a/src/plugins/template/backend/opset_int_tbl.hpp
+++ b/src/plugins/template/backend/opset_int_tbl.hpp
@@ -22,7 +22,6 @@ _OPENVINO_OP_REG(HardSigmoid, op::v0)
_OPENVINO_OP_REG(Interpolate, op::v0)
_OPENVINO_OP_REG(LRN, op::v0)
_OPENVINO_OP_REG(LSTMCell, op::v0)
-_OPENVINO_OP_REG(LSTMSequence, op::v0)
_OPENVINO_OP_REG(MVN, op::v0)
_OPENVINO_OP_REG(NormalizeL2, op::v0)
_OPENVINO_OP_REG(PriorBox, op::v0)
diff --git a/src/plugins/template/tests/functional/op_reference/lstm_sequence.cpp b/src/plugins/template/tests/functional/op_reference/lstm_sequence.cpp
index fe9ad2ddde7..999c7f5c669 100644
--- a/src/plugins/template/tests/functional/op_reference/lstm_sequence.cpp
+++ b/src/plugins/template/tests/functional/op_reference/lstm_sequence.cpp
@@ -241,90 +241,10 @@ private:
}
};
-class ReferenceLSTMSequenceV1Test : public testing::TestWithParam<LSTMSequenceV1Params>, public CommonReferenceTest {
-public:
- void SetUp() override {
- legacy_compare = true;
- auto params = GetParam();
- function = CreateFunction(params);
- inputData = {params.X.data,
- params.H_t.data,
- params.C_t.data,
- params.S_t.data,
- params.W.data,
- params.R.data,
- params.B.data,
- params.P.data};
- refOutData = {params.Y.data, params.Ho.data, params.Co.data};
- }
-
- static std::string getTestCaseName(const testing::TestParamInfo<LSTMSequenceV1Params>& obj) {
- auto param = obj.param;
- std::ostringstream result;
- result << "iType=" << param.iType << "_";
- result << "xShape=" << param.X.shape << "_";
- result << "htShape=" << param.H_t.shape << "_";
- result << "ctShape=" << param.C_t.shape << "_";
- result << "stShape=" << param.S_t.shape << "_";
- result << "wShape=" << param.W.shape << "_";
- result << "rShape=" << param.R.shape << "_";
- result << "bShape=" << param.B.shape << "_";
- result << "pShape=" << param.P.shape << "_";
- result << "YShape=" << param.Y.shape << "_";
- result << "hoShape=" << param.Ho.shape << "_";
- result << "coShape=" << param.Co.shape << "_";
- result << "clip=" << param.clip << "_";
- result << "input_forget=" << param.input_forget << "_";
- result << "LSTMdirection=" << param.lstm_direction;
- if (!param.testcaseName.empty())
- result << "_" << param.testcaseName;
-
- return result.str();
- }
-
-private:
- static std::shared_ptr<Model> CreateFunction(const LSTMSequenceV1Params& params) {
- const auto X = std::make_shared<op::v0::Parameter>(params.X.type, params.X.shape);
- const auto H_t = std::make_shared<op::v0::Parameter>(params.H_t.type, params.H_t.shape);
- const auto C_t = std::make_shared<op::v0::Parameter>(params.C_t.type, params.C_t.shape);
- const auto S_t = std::make_shared<op::v0::Parameter>(params.S_t.type, params.S_t.shape);
- const auto W = std::make_shared<op::v0::Parameter>(params.W.type, params.W.shape);
- const auto R = std::make_shared<op::v0::Parameter>(params.R.type, params.R.shape);
- const auto B = std::make_shared<op::v0::Parameter>(params.B.type, params.B.shape);
- const auto P = std::make_shared<op::v0::Parameter>(params.P.type, params.P.shape);
-
- const auto lstm_sequence =
- std::make_shared<op::v0::LSTMSequence>(X,
- H_t,
- C_t,
- S_t,
- W,
- R,
- B,
- P,
- params.hiddenSize,
- params.lstm_direction,
- ov::op::LSTMWeightsFormat::FICO,
- std::vector<float>{},
- std::vector<float>{},
- std::vector<std::string>{"sigmoid", "tanh", "tanh"},
- params.clip,
- params.input_forget);
-
- auto function =
- std::make_shared<Model>(lstm_sequence->outputs(), ParameterVector{X, H_t, C_t, S_t, W, R, B, P});
- return function;
- }
-};
-
TEST_P(ReferenceLSTMSequenceTest, CompareWithRefs) {
Exec();
}
-TEST_P(ReferenceLSTMSequenceV1Test, CompareWithRefs) {
- Exec();
-}
-
template <element::Type_t ET>
std::vector<LSTMSequenceParams> generateParams() {
using T = typename element_type_traits<ET>::value_type;
@@ -3481,10 +3401,4 @@ INSTANTIATE_TEST_SUITE_P(smoke_LSTMSequence_With_Hardcoded_Refs,
ReferenceLSTMSequenceTest,
testing::ValuesIn(generateCombinedParams()),
ReferenceLSTMSequenceTest::getTestCaseName);
-
-INSTANTIATE_TEST_SUITE_P(smoke_LSTMSequence_With_Hardcoded_Refs,
- ReferenceLSTMSequenceV1Test,
- testing::ValuesIn(generateV1CombinedParams()),
- ReferenceLSTMSequenceV1Test::getTestCaseName);
-
} // namespace
diff --git a/src/tests/functional/plugin/conformance/test_runner/op_conformance_runner/src/op_impl_check/single_op_graph.cpp b/src/tests/functional/plugin/conformance/test_runner/op_conformance_runner/src/op_impl_check/single_op_graph.cpp
index bcb259cd49b..fb192e0ac40 100644
--- a/src/tests/functional/plugin/conformance/test_runner/op_conformance_runner/src/op_impl_check/single_op_graph.cpp
+++ b/src/tests/functional/plugin/conformance/test_runner/op_conformance_runner/src/op_impl_check/single_op_graph.cpp
@@ -2017,22 +2017,6 @@ std::shared_ptr<ov::Model> generateRNNCellBase(const std::shared_ptr<ov::op::Op>
ov::op::RecurrentSequenceDirection::FORWARD);
ov::ResultVector results{std::make_shared<ov::op::v0::Result>(gru_sequence)};
return std::make_shared<ov::Model>(results, params, "GRUSequence");
- } else if (ov::is_type<ov::op::v0::LSTMSequence>(node)) {
- ov::ParameterVector params{std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{{5, 10, 10}}),
- std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{{5, 1, 10}}),
- std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{{5, 1, 10}}),
- std::make_shared<ov::op::v0::Parameter>(ov::element::i64, ov::Shape{5})};
-
- const auto W = std::make_shared<ov::op::v0::Constant>(utils::create_and_fill_tensor(ov::element::f32, ov::Shape{1, 40, 10}));
- const auto R = std::make_shared<ov::op::v0::Constant>(utils::create_and_fill_tensor(ov::element::f32, ov::Shape{1, 40, 10}));
- const auto B = std::make_shared<ov::op::v0::Constant>(utils::create_and_fill_tensor(ov::element::f32, ov::Shape{1, 40}));
- const auto P = std::make_shared<ov::op::v0::Constant>(utils::create_and_fill_tensor(ov::element::f32, ov::Shape{1, 30}));
- RNNCellBaseNode = std::make_shared<ov::op::v0::LSTMSequence>(params.at(0), params.at(1), params.at(2), params.at(3),
- W, R, B, 10, ov::op::RecurrentSequenceDirection::FORWARD);
- ov::ResultVector results{std::make_shared<ov::op::v0::Result>(RNNCellBaseNode->output(0)),
- std::make_shared<ov::op::v0::Result>(RNNCellBaseNode->output(1)),
- std::make_shared<ov::op::v0::Result>(RNNCellBaseNode->output(2))};
- return std::make_shared<ov::Model>(results, params, "LSTMSeq1BaseGraph");
} else if (ov::is_type<ov::op::v5::LSTMSequence>(node)) {
ov::ParameterVector params{std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{{5, 10, 10}}),
std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{{5, 1, 10}}),