OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[Op] ISTFT op class, shape infer and reference (#28606)
Katarzyna Mitruse4611ea7ef68
diff --git a/src/core/include/openvino/op/istft.hpp b/src/core/include/openvino/op/istft.hppnew file mode 100644index 00000000000..05eac05cb13--- /dev/null+++ b/src/core/include/openvino/op/istft.hpp@@ -0,0 +1,62 @@+// Copyright (C) 2018-2025 Intel Corporation+// SPDX-License-Identifier: Apache-2.0+//++#pragma once++#include "openvino/op/op.hpp"++namespace ov::op::v16 {+/// \brief An operation ISTFT that computes the Inverse Short Time Fourier Transform.+/// \ingroup ov_ops_cpp_api+class OPENVINO_API ISTFT : public Op {+public:+ OPENVINO_OP("ISTFT", "opset16");+ ISTFT() = default;++ /// \brief Constructs an ISTFT operation with signal length to be inferred+ ///+ /// \param data Input data+ /// \param window Window values applied in ISTFT+ /// \param frame_size Scalar value representing the size of Fourier Transform+ /// \param frame_step The distance (number of samples) between successive window frames+ /// \param center Flag signaling if the signal input has been padded before STFT+ /// \param normalized Flag signaling if the STFT result has been normalized+ ISTFT(const Output<Node>& data,+ const Output<Node>& window,+ const Output<Node>& frame_size,+ const Output<Node>& frame_step,+ const bool center,+ const bool normalized);++ /// \brief Constructs an ISTFT operation with signal length provided+ ///+ /// \param data Input data+ /// \param window Window values applied in ISTFT+ /// \param frame_size Scalar value representing the size of Fourier Transform+ /// \param frame_step The distance (number of samples) between successive window frames+ /// \param signal_length The signal length of the original signal+ /// \param center Flag signaling if the signal input has been padded before STFT+ /// \param normalized Flag signaling if the STFT result has been normalized+ ISTFT(const Output<Node>& data,+ const Output<Node>& window,+ const Output<Node>& frame_size,+ const Output<Node>& frame_step,+ const Output<Node>& signal_length,+ const bool center,+ const bool normalized);++ bool visit_attributes(AttributeVisitor& visitor) override;+ void validate_and_infer_types() override;+ std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& new_args) const override;++ bool get_center() const;+ void set_center(const bool center);++ bool get_normalized() const;++private:+ bool m_center = false;+ bool m_normalized = false;+};+} // namespace ov::op::v16diff --git a/src/core/include/openvino/op/ops.hpp b/src/core/include/openvino/op/ops.hppindex 3605f421530..1df29258cb8 100644--- a/src/core/include/openvino/op/ops.hpp+++ b/src/core/include/openvino/op/ops.hpp@@ -99,6 +99,7 @@#include "openvino/op/is_finite.hpp"#include "openvino/op/is_inf.hpp"#include "openvino/op/is_nan.hpp"+#include "openvino/op/istft.hpp"#include "openvino/op/less.hpp"#include "openvino/op/less_eq.hpp"#include "openvino/op/log.hpp"diff --git a/src/core/include/openvino/opsets/opset16_tbl.hpp b/src/core/include/openvino/opsets/opset16_tbl.hppindex 96c3c4215c9..de0b3a9ed95 100644--- a/src/core/include/openvino/opsets/opset16_tbl.hpp+++ b/src/core/include/openvino/opsets/opset16_tbl.hpp@@ -15,3 +15,4 @@ _OPENVINO_OP_REG(ShapeOf, ov::op::v3)// New operations added in opset16_OPENVINO_OP_REG(Identity, ov::op::v16)+_OPENVINO_OP_REG(ISTFT, ov::op::v16)diff --git a/src/core/reference/include/openvino/reference/istft.hpp b/src/core/reference/include/openvino/reference/istft.hppnew file mode 100644index 00000000000..725548d2e70--- /dev/null+++ b/src/core/reference/include/openvino/reference/istft.hpp@@ -0,0 +1,22 @@+// Copyright (C) 2018-2025 Intel Corporation+// SPDX-License-Identifier: Apache-2.0+//++#pragma once++#include "openvino/core/shape.hpp"++namespace ov {+namespace reference {+void istft(const float* in_data,+ const float* window,+ float* final_result,+ const Shape& signal_shape,+ const Shape& window_shape,+ const int64_t frame_size,+ const int64_t frame_step,+ const int64_t length,+ const bool center,+ const bool normalized);+} // namespace reference+} // namespace ovdiff --git a/src/core/reference/src/op/istft.cpp b/src/core/reference/src/op/istft.cppnew file mode 100644index 00000000000..b01b5ee1896--- /dev/null+++ b/src/core/reference/src/op/istft.cpp@@ -0,0 +1,131 @@+// Copyright (C) 2018-2025 Intel Corporation+// SPDX-License-Identifier: Apache-2.0+//++#include "openvino/reference/istft.hpp"++#include <algorithm>+#include <functional>+#include <vector>++#include "openvino/core/shape.hpp"+#include "openvino/reference/add.hpp"+#include "openvino/reference/irdft.hpp"+#include "openvino/reference/transpose.hpp"++namespace ov {+namespace reference {+void istft(const float* in_data,+ const float* window,+ float* final_result,+ const Shape& data_shape,+ const Shape& window_shape,+ const int64_t frame_size,+ const int64_t frame_step,+ const int64_t length,+ const bool center,+ const bool normalized) {+ const auto is_data_3D = data_shape.size() == 3;+ const size_t frames_axis = 1 + (is_data_3D ? 0 : 1);+ const size_t batch_size = is_data_3D ? 1 : data_shape[0];++ const auto sqrt_frame_size = static_cast<float>(std::sqrt(frame_size));+ const auto num_frames = data_shape[frames_axis];++ const auto signal_length = (num_frames - 1) * frame_step + frame_size;+ const int64_t final_signal_length = length > 0 ? length : (center ? (signal_length - frame_size) : signal_length);+ std::fill(final_result, final_result + batch_size * final_signal_length, 0.f);++ std::vector<float> mid_result(batch_size * signal_length, 0.f);+ float* result = mid_result.data();++ const auto frame_size_dim = static_cast<size_t>(frame_size);+ const auto frame_size_dim_shape = Shape{frame_size_dim};+ const auto frame_size_dim_shape_out = Shape{frame_size_dim, 2};+ const auto fft_out_shape = Shape{static_cast<size_t>((frame_size_dim / 2) + 1), 2};++ const auto window_length = window_shape[0] < frame_size_dim ? window_shape[0] : frame_size_dim;+ std::vector<float> pad_window(frame_size, 0);+ std::copy(window, window + window_shape[0], pad_window.begin() + (frame_size_dim - window_length) / 2);++ std::vector<float> data_t(in_data, in_data + shape_size(data_shape));+ const auto stft_transp_out_shape = Shape{batch_size, num_frames, fft_out_shape[0], fft_out_shape[1]};+ transpose(reinterpret_cast<const char*>(in_data),+ reinterpret_cast<char*>(data_t.data()),+ Shape{batch_size, fft_out_shape[0], num_frames, fft_out_shape[1]},+ sizeof(float),+ {0, 2, 1, 3},+ stft_transp_out_shape);++ // Setting function for the result postprocessing+ const auto norm_window_div = [sqrt_frame_size](float a, float b) {+ if (b != 0.f)+ return (a * sqrt_frame_size) / b;+ else+ return 0.f;+ };+ const auto window_div = [](float a, float b) {+ if (b != 0.f)+ return a / b;+ else+ return 0.f;+ };+ std::function<float(float, float)> postprocess_func;+ if (normalized) {+ postprocess_func = norm_window_div;+ } else {+ postprocess_func = window_div;+ }++ const auto fft_out_shape_size = shape_size(fft_out_shape);+ const auto in_batch_single_step = num_frames * fft_out_shape_size;+ const int64_t margin = center ? (frame_size / 2) : 0;+ const int64_t data_end = signal_length - margin;+ const int64_t copy_end = final_signal_length < data_end ? final_signal_length : data_end;++ std::vector<float> window_sum(batch_size * signal_length);+ std::vector<float> frame_signal(frame_size);++ for (size_t batch = 0, batch_in_start = 0, batch_out_start = 0; batch < batch_size; ++batch) {+ for (size_t frame_idx = 0; frame_idx < num_frames; ++frame_idx) {+ const auto in_frame_start = batch_in_start + frame_idx * fft_out_shape_size;+ const auto in_frame_end = in_frame_start + fft_out_shape_size;++ const auto out_frame_start = batch_out_start + frame_idx * frame_step;+ const auto out_frame_end = out_frame_start + frame_size;++ std::vector<float> frame_data(data_t.data() + in_frame_start, data_t.data() + in_frame_end);+ reference::irdft(frame_data,+ fft_out_shape,+ {0},+ frame_signal.data(),+ frame_size_dim_shape_out,+ frame_size_dim_shape,+ frame_size);++ std::transform(frame_signal.begin(),+ frame_signal.end(),+ mid_result.begin() + out_frame_start,+ mid_result.begin() + out_frame_start,+ func::add<float>);++ std::transform(window_sum.begin() + out_frame_start,+ window_sum.begin() + out_frame_end,+ pad_window.begin(),+ window_sum.begin() + out_frame_start,+ func::add<float>);+ }++ std::transform(result, result + signal_length, window_sum.begin(), result, postprocess_func);++ const auto result_start = result + margin;+ std::copy(result_start, result_start + copy_end, final_result);++ batch_in_start += in_batch_single_step;+ batch_out_start += signal_length;+ result += batch_out_start;+ final_result += final_signal_length;+ }+}+} // namespace reference+} // namespace ovdiff --git a/src/core/shape_inference/include/istft_shape_inference.hpp b/src/core/shape_inference/include/istft_shape_inference.hppnew file mode 100644index 00000000000..d013c8e305c--- /dev/null+++ b/src/core/shape_inference/include/istft_shape_inference.hpp@@ -0,0 +1,119 @@+// Copyright (C) 2018-2025 Intel Corporation+// SPDX-License-Identifier: Apache-2.0+//++#pragma once++#include "dimension_util.hpp"+#include "openvino/op/istft.hpp"+#include "utils.hpp"++namespace ov::op::v16 {+template <class TShape, class TRShape = result_shape_t<TShape>>+std::vector<TRShape> shape_infer(const ISTFT* op,+ const std::vector<TShape>& input_shapes,+ const ITensorAccessor& ta = make_tensor_accessor()) {+ using TDim = typename TRShape::value_type;+ using TDimVal = typename TDim::value_type;++ const auto inputs_count = input_shapes.size();+ const auto is_in_count_correct = inputs_count == 4 || inputs_count == 5;+ NODE_VALIDATION_CHECK(op, is_in_count_correct);++ const auto& data_shape = input_shapes[0];+ const auto& window_shape = input_shapes[1];+ const auto& frame_size_shape = input_shapes[2];+ const auto& frame_step_shape = input_shapes[3];++ const auto data_shape_rank = data_shape.rank();+ NODE_SHAPE_INFER_CHECK(op,+ input_shapes,+ data_shape_rank.compatible(3) || data_shape_rank.compatible(4),+ "The shape of data must be 3D or 4D.");+ NODE_SHAPE_INFER_CHECK(op,+ input_shapes,+ window_shape.rank().compatible(1),+ "The shape of window must be 1D [window_size].");+ NODE_SHAPE_INFER_CHECK(op,+ input_shapes,+ frame_size_shape.rank().compatible(0),+ "The shape of frame_size must be a scalar.");+ NODE_SHAPE_INFER_CHECK(op,+ input_shapes,+ frame_step_shape.rank().compatible(0),+ "The shape of frame_step must be a scalar.");++ const auto frame_size = get_input_const_data_as<TRShape, int64_t>(op, 2, ta);+ const auto frame_step = get_input_const_data_as<TRShape, int64_t>(op, 3, ta);++ if (frame_size) {+ const auto& frame_size_val = (*frame_size)[0];+ NODE_SHAPE_INFER_CHECK(op,+ input_shapes,+ 0 < frame_size_val,+ "Provided frame size must be greater than zero, but got: ",+ frame_size_val);+ const bool is_win_shape_correct =+ window_shape.is_dynamic() || (TDimVal{0} < window_shape[0].get_length() &&+ window_shape[0].get_length() <= static_cast<TDimVal>(frame_size_val));++ NODE_SHAPE_INFER_CHECK(op,+ input_shapes,+ is_win_shape_correct,+ "Window input dimension must be in range [1, ",+ frame_size_val,+ "].");+ }++ if (frame_step) {+ const auto& frame_step_val = (*frame_step)[0];+ NODE_SHAPE_INFER_CHECK(op,+ input_shapes,+ 0 < frame_step_val,+ "Provided frame step must be greater than zero, but got: ",+ frame_step_val);+ }++ // For the input with dynamic rank, output shape is also fully dynamic+ if (data_shape_rank.is_dynamic()) {+ return {data_shape};+ }+ const auto is_data_3D = data_shape.size() == 3;++ // Init output shape with dynamic dimension and update if more info can be inferred+ std::vector<TRShape> output_shapes{TRShape{TDim(ov::util::dim::inf_bound)}};+ if (inputs_count == 5) {+ const auto& length_shape = input_shapes[4];+ const bool has_len_valid_shape =+ length_shape.rank().is_dynamic() ||+ (length_shape.size() == 0 || (length_shape.size() == 1 && length_shape[0].compatible(1)));+ NODE_SHAPE_INFER_CHECK(op,+ input_shapes,+ has_len_valid_shape,+ "The shape of 'signal_length' input must be a scalar or single element 1D tensor.");++ const auto sig_len_in = get_input_const_data_as_shape<TRShape>(op, 4, ta);+ if (sig_len_in) { // Set desired length of the signal dimension, if provided+ output_shapes[0][0] = TDim{(*sig_len_in)[0]};+ }+ } else if (frame_size && frame_step) { // Otherwise infer the length of the signal+ const auto& frame_size_val = (*frame_size)[0];+ const auto& frame_step_val = (*frame_step)[0];++ const int64_t frames_axis = 1 + (is_data_3D ? 0 : 1);+ const TDim& num_frames_dim = data_shape[frames_axis];+ TDim signal_length = (num_frames_dim - 1) * frame_step_val;+ if (!op->get_center()) {+ signal_length += frame_size_val;+ }+ output_shapes[0][0] = std::move(signal_length);+ }++ if (!is_data_3D) { // Copy batch dimension+ const auto& batch_dim = data_shape[0];+ output_shapes[0].insert(output_shapes[0].begin(), batch_dim);+ }++ return output_shapes;+}+} // namespace ov::op::v16diff --git a/src/core/src/op/istft.cpp b/src/core/src/op/istft.cppnew file mode 100644index 00000000000..5caed0ec9dc--- /dev/null+++ b/src/core/src/op/istft.cpp@@ -0,0 +1,117 @@+// Copyright (C) 2018-2025 Intel Corporation+// SPDX-License-Identifier: Apache-2.0+//++#include "openvino/op/istft.hpp"++#include <memory>++#include "istft_shape_inference.hpp"+#include "itt.hpp"+#include "openvino/reference/istft.hpp"++namespace ov::op::v16 {+namespace {+void check_int_input_at(const Node* op, size_t port) {+ const auto& in_type = op->get_input_element_type(port);+ const auto has_valid_type = in_type.is_dynamic() || in_type == element::i32 || in_type == element::i64;+ NODE_VALIDATION_CHECK(op, has_valid_type, "Expected i32 or i64 type of the input at port: ", port);+}+} // namespace+ISTFT::ISTFT(const Output<Node>& data,+ const Output<Node>& window,+ const Output<Node>& frame_size,+ const Output<Node>& frame_step,+ const bool center,+ const bool normalized)+ : Op({data, window, frame_size, frame_step}),+ m_center(center),+ m_normalized(normalized) {+ constructor_validate_and_infer_types();+}++ISTFT::ISTFT(const Output<Node>& data,+ const Output<Node>& window,+ const Output<Node>& frame_size,+ const Output<Node>& frame_step,+ const Output<Node>& signal_length,+ const bool center,+ const bool normalized)+ : Op({data, window, frame_size, frame_step, signal_length}),+ m_center(center),+ m_normalized(normalized) {+ constructor_validate_and_infer_types();+}++std::shared_ptr<Node> ISTFT::clone_with_new_inputs(const OutputVector& new_args) const {+ OV_OP_SCOPE(v16_ISTFT_clone_with_new_inputs);+ check_new_args_count(this, new_args);++ if (new_args.size() == 4) {+ return std::make_shared<ISTFT>(new_args.at(0),+ new_args.at(1),+ new_args.at(2),+ new_args.at(3),+ m_center,+ m_normalized);+ }+ return std::make_shared<ISTFT>(new_args.at(0),+ new_args.at(1),+ new_args.at(2),+ new_args.at(3),+ new_args.at(4),+ m_center,+ m_normalized);+}++bool ISTFT::visit_attributes(AttributeVisitor& visitor) {+ OV_OP_SCOPE(v16_ISTFT_visit_attributes);+ visitor.on_attribute("center", m_center);+ visitor.on_attribute("normalized", m_normalized);+ return true;+}++void ISTFT::validate_and_infer_types() {+ OV_OP_SCOPE(v16_ISTFT_validate_and_infer_types);+ const auto input_size = get_input_size();+ const auto is_input_count_correct = input_size == 4 || input_size == 5;+ NODE_VALIDATION_CHECK(this, is_input_count_correct, "Expected 4 or 5 inputs to be provided.");++ auto data_type = get_input_element_type(0);+ const auto& window_type = get_input_element_type(1);++ const auto has_valid_data_type = data_type.is_dynamic() || data_type.is_real();+ NODE_VALIDATION_CHECK(this, has_valid_data_type, "Expected floating point type of the 'data' input.");++ const auto has_valid_window_type =+ window_type.is_dynamic() || (window_type.is_real() && element::Type::merge(data_type, window_type, data_type));+ NODE_VALIDATION_CHECK(this,+ has_valid_window_type,+ "Expected floating point type of the 'window' input, matching the type of `data` input.");++ for (size_t port = 2; port < input_size; ++port) {+ check_int_input_at(this, port);+ }++ const auto input_shapes = ov::util::get_node_input_partial_shapes(*this);+ const auto output_shapes = shape_infer(this, input_shapes);++ set_output_type(0, data_type, output_shapes[0]);+}++bool ISTFT::get_center() const {+ OV_OP_SCOPE(v16_ISTFT_get_center);+ return m_center;+}++void ISTFT::set_center(const bool center) {+ OV_OP_SCOPE(v16_ISTFT_set_center);+ m_center = center;+}++bool ISTFT::get_normalized() const {+ OV_OP_SCOPE(v16_ISTFT_get_normalized);+ return m_normalized;+}++} // namespace ov::op::v16diff --git a/src/core/tests/opset.cpp b/src/core/tests/opset.cppindex b4908288c34..dc24a832560 100644--- a/src/core/tests/opset.cpp+++ b/src/core/tests/opset.cpp@@ -77,7 +77,7 @@ INSTANTIATE_TEST_SUITE_P(opset,OpsetTestParams{ov::get_opset13, 186},OpsetTestParams{ov::get_opset14, 188},OpsetTestParams{ov::get_opset15, 199},- OpsetTestParams{ov::get_opset16, 4}),+ OpsetTestParams{ov::get_opset16, 5}),OpsetTestNameGenerator{});class MyOpOld : public ov::op::Op {diff --git a/src/core/tests/type_prop/istft.cpp b/src/core/tests/type_prop/istft.cppnew file mode 100644index 00000000000..a643e472e2c--- /dev/null+++ b/src/core/tests/type_prop/istft.cpp@@ -0,0 +1,438 @@+// Copyright (C) 2018-2025 Intel Corporation+// SPDX-License-Identifier: Apache-2.0+//++#include "openvino/op/istft.hpp"++#include <gtest/gtest.h>++#include "common_test_utils/test_assertions.hpp"+#include "common_test_utils/type_prop.hpp"+#include "openvino/op/constant.hpp"+#include "openvino/op/shape_of.hpp"+#include "openvino/op/subtract.hpp"++namespace ov::test {++using op::v0::Constant;+using op::v0::Parameter;+using testing::HasSubstr;++class TypePropISTFTTest : public TypePropOpTest<op::v16::ISTFT> {+public:+ bool center = false;+ bool normalized = false;+};++TEST_F(TypePropISTFTTest, default_ctor) {+ const auto op = make_op();+ const auto data = std::make_shared<Parameter>(element::f32, PartialShape{4, 6, 16, 2});+ const auto window = std::make_shared<Parameter>(element::f32, PartialShape{7});+ const auto frame_size = Constant::create<int32_t>(element::i32, {}, {11});+ const auto frame_step = Constant::create<int32_t>(element::i32, {}, {3});++ op->set_arguments(OutputVector{data, window, frame_size, frame_step});+ op->validate_and_infer_types();++ op->set_center(true);++ EXPECT_EQ(op->get_output_size(), 1);+ EXPECT_EQ(op->get_input_size(), 4);+ EXPECT_EQ(op->get_output_element_type(0), element::f32);+ EXPECT_EQ(op->get_output_partial_shape(0), (PartialShape{4, 56}));+}++TEST_F(TypePropISTFTTest, all_inputs_as_params_static_shapes_auto_length) {+ const auto in_data = std::make_shared<Parameter>(element::f32, PartialShape{2, 1, 4, 48});+ const auto window = std::make_shared<Parameter>(element::f32, PartialShape{7});+ const auto frame_size = std::make_shared<Parameter>(element::i64, PartialShape{});+ const auto frame_step = std::make_shared<Parameter>(element::i64, PartialShape{});++ const auto op = make_op(in_data, window, frame_size, frame_step, center, normalized);+ EXPECT_EQ(op->get_output_size(), 1);+ EXPECT_EQ(op->get_output_element_type(0), element::f32);+ EXPECT_EQ(op->get_output_partial_shape(0), (PartialShape{2, -1}));+}++TEST_F(TypePropISTFTTest, all_inputs_as_params_static_shapes_in_length) {+ const auto in_data = std::make_shared<Parameter>(element::f32, PartialShape{2, 1, 4, 48});+ const auto window = std::make_shared<Parameter>(element::f32, PartialShape{7});+ const auto frame_size = std::make_shared<Parameter>(element::i64, PartialShape{});+ const auto frame_step = std::make_shared<Parameter>(element::i64, PartialShape{});+ const auto length = std::make_shared<Parameter>(element::i64, PartialShape{});++ const auto op = make_op(in_data, window, frame_size, frame_step, length, center, normalized);+ EXPECT_EQ(op->get_output_size(), 1);+ EXPECT_EQ(op->get_output_element_type(0), element::f32);+ EXPECT_EQ(op->get_output_partial_shape(0), (PartialShape{2, -1}));+}++TEST_F(TypePropISTFTTest, all_inputs_as_params_f16_static_shapes) {+ const auto in_data = std::make_shared<Parameter>(element::f16, PartialShape{2, 1, 4, 48});+ const auto window = std::make_shared<Parameter>(element::f16, PartialShape{7});+ const auto frame_size = std::make_shared<Parameter>(element::i64, PartialShape{});+ const auto frame_step = std::make_shared<Parameter>(element::i64, PartialShape{});++ const auto op = make_op(in_data, window, frame_size, frame_step, center, normalized);+ EXPECT_EQ(op->get_output_size(), 1);+ EXPECT_EQ(op->get_output_element_type(0), element::f16);+ EXPECT_EQ(op->get_output_partial_shape(0), (PartialShape{2, -1}));+}++TEST_F(TypePropISTFTTest, all_inputs_as_params_dyn_shapes) {+ const auto in_data = std::make_shared<Parameter>(element::f32, PartialShape{-1, -1, -1, 2});+ const auto window = std::make_shared<Parameter>(element::f32, PartialShape{-1});+ const auto frame_size = std::make_shared<Parameter>(element::i64, PartialShape::dynamic());+ const auto frame_step = std::make_shared<Parameter>(element::i64, PartialShape::dynamic());+ const auto length = std::make_shared<Parameter>(element::i64, PartialShape{});++ const auto op = make_op(in_data, window, frame_size, frame_step, length, center, normalized);+ EXPECT_EQ(op->get_output_size(), 1);+ EXPECT_EQ(op->get_output_element_type(0), element::f32);+ EXPECT_EQ(op->get_output_partial_shape(0), (PartialShape{-1, -1}));+}++TEST_F(TypePropISTFTTest, all_inputs_as_params_dyn_rank) {+ const auto in_data = std::make_shared<Parameter>(element::f32, PartialShape::dynamic());+ const auto window = std::make_shared<Parameter>(element::f32, PartialShape::dynamic());+ const auto frame_size = std::make_shared<Parameter>(element::i64, PartialShape::dynamic());+ const auto frame_step = std::make_shared<Parameter>(element::i64, PartialShape::dynamic());+ const auto length = std::make_shared<Parameter>(element::i64, PartialShape::dynamic());++ const auto op = make_op(in_data, window, frame_size, frame_step, length, center, normalized);+ EXPECT_EQ(op->get_output_size(), 1);+ EXPECT_EQ(op->get_output_element_type(0), element::f32);+ EXPECT_EQ(op->get_output_partial_shape(0), PartialShape::dynamic());+}++using STFTTestParam = std::tuple<PartialShape, PartialShape, int32_t, int32_t, bool, PartialShape>;+class TypePropISTFTTestP : public TypePropISTFTTest, public testing::WithParamInterface<STFTTestParam> {+protected:+ void SetUp() override {+ std::tie(signal_shape, window_shape, frame_size_val, step_size_val, center, data_shape) = GetParam();+ }+ PartialShape signal_shape, window_shape, data_shape;+ int32_t frame_size_val, step_size_val;+};++INSTANTIATE_TEST_SUITE_P(+ type_prop_stft_shape,+ TypePropISTFTTestP,+ testing::Values(+ std::make_tuple(PartialShape{16}, PartialShape{16}, 16, 16, false, PartialShape{9, 1, 2}), // frames at 1+ std::make_tuple(PartialShape{16}, PartialShape{16}, 16, 4, false, PartialShape{9, 1, 2}),+ std::make_tuple(PartialShape{48}, PartialShape{16}, 16, 16, false, PartialShape{9, 3, 2}),+ std::make_tuple(PartialShape{8, 48}, PartialShape{16}, 16, 16, false, PartialShape{8, 9, 3, 2}),+ std::make_tuple(PartialShape{48}, PartialShape{16}, 16, 16, true, PartialShape{9, 4, 2}),+ std::make_tuple(PartialShape{5, 48}, PartialShape{16}, 16, 16, true, PartialShape{5, 9, 4, 2}),+ std::make_tuple(PartialShape{48}, PartialShape{16}, 16, 12, true, PartialShape{9, 5, 2}),+ std::make_tuple(PartialShape{56}, PartialShape{7}, 11, 3, false, PartialShape{6, 16, 2}),++ std::make_tuple(PartialShape{48}, PartialShape{8}, 16, 4, false, PartialShape{9, 9, 2}),+ std::make_tuple(PartialShape{{47, 56}}, PartialShape{7}, 11, 3, false, PartialShape{6, {13, 16}, 2}),+ std::make_tuple(PartialShape{{11, -1}}, PartialShape{7}, 11, 3, false, PartialShape{6, {1, -1}, 2}),+ std::make_tuple(PartialShape{1, 16}, PartialShape{16}, 16, 16, false, PartialShape{1, 9, 1, 2}),+ std::make_tuple(PartialShape{1, 48}, PartialShape{16}, 16, 16, false, PartialShape{1, 9, 3, 2}),+ std::make_tuple(PartialShape{2, 48}, PartialShape{8}, 16, 4, false, PartialShape{2, 9, 9, 2}),+ std::make_tuple(PartialShape{2, 9}, PartialShape{5}, 9, 100, false, PartialShape{2, 5, 1, 2}),+ std::make_tuple(PartialShape{2, 0}, PartialShape{5}, 9, 100, true, PartialShape{2, 5, 1, 2}),+ std::make_tuple(PartialShape{4, 47},+ PartialShape{7},+ 11,+ 3,+ false,+ PartialShape{4, 6, 13, 2}), // If the signal was 48, the last sample can be lost+ std::make_tuple(PartialShape{4, 56}, PartialShape{7}, 11, 3, false, PartialShape{4, 6, 16, 2}),+ std::make_tuple(PartialShape{-1, {11, -1}}, PartialShape{7}, 11, 3, false, PartialShape{-1, 6, {1, -1}, 2}),+ std::make_tuple(PartialShape{-1, {47, 56}}, PartialShape{7}, 11, 3, false, PartialShape{-1, 6, {13, 16}, 2}),+ std::make_tuple(PartialShape{{2, 4}, {11, -1}},+ PartialShape{7},+ 11,+ 3,+ false,+ PartialShape{{2, 4}, 6, {1, -1}, 2}),+ std::make_tuple(PartialShape{{2, 4}, {-1, -1}},+ PartialShape{7},+ 11,+ 3,+ true,+ PartialShape{{2, 4}, 6, {1, -1}, 2}),++ std::make_tuple(PartialShape::dynamic(), PartialShape{7}, 11, 3, false, PartialShape::dynamic()),++ std::make_tuple(PartialShape::dynamic(), PartialShape::dynamic(), 11, 3, false, PartialShape::dynamic()),+ std::make_tuple(PartialShape::dynamic(), PartialShape::dynamic(), 11, 3, true, PartialShape::dynamic())),+ testing::PrintToStringParamName());++TEST_P(TypePropISTFTTestP, istft_shapes) {+ const auto in_data = std::make_shared<Parameter>(element::f32, data_shape);+ const auto window = std::make_shared<Parameter>(element::f32, window_shape);+ const auto frame_size = Constant::create<int32_t>(element::i32, {}, {frame_size_val});+ const auto frame_step = Constant::create<int32_t>(element::i32, {}, {step_size_val});++ const auto op = make_op(in_data, window, frame_size, frame_step, center, normalized);+ EXPECT_EQ(op->get_output_size(), 1);+ EXPECT_EQ(op->get_output_element_type(0), element::f32);+ EXPECT_EQ(op->get_output_partial_shape(0), signal_shape);+}++TEST_F(TypePropISTFTTest, shape_length_const_out_1D) {+ const auto in_data = std::make_shared<Parameter>(element::f32, PartialShape{6, 13, 2});+ const auto window = std::make_shared<Parameter>(element::f32, PartialShape{7});+ const auto frame_size = Constant::create<int32_t>(element::i32, {}, {11});+ const auto frame_step = Constant::create<int32_t>(element::i32, {}, {3});+ const auto signal_length = Constant::create<int32_t>(element::i32, {}, {36});++ const auto op = make_op(in_data, window, frame_size, frame_step, signal_length, center, normalized);+ EXPECT_EQ(op->get_output_size(), 1);+ EXPECT_EQ(op->get_output_element_type(0), element::f32);+ EXPECT_EQ(op->get_output_partial_shape(0), (PartialShape{36}));+}++TEST_F(TypePropISTFTTest, shape_length_const_out_2D) {+ const auto in_data = std::make_shared<Parameter>(element::f32, PartialShape{4, 6, 13, 2});+ const auto window = std::make_shared<Parameter>(element::f32, PartialShape{7});+ const auto frame_size = Constant::create<int32_t>(element::i32, {}, {11});+ const auto frame_step = Constant::create<int32_t>(element::i32, {}, {3});+ const auto signal_length = Constant::create<int32_t>(element::i32, {}, {36});++ const auto op = make_op(in_data, window, frame_size, frame_step, signal_length, center, normalized);+ EXPECT_EQ(op->get_output_size(), 1);+ EXPECT_EQ(op->get_output_element_type(0), element::f32);+ EXPECT_EQ(op->get_output_partial_shape(0), (PartialShape{4, 36}));+}++TEST_F(TypePropISTFTTest, shape_of_length_out_2D_with_symbols) {+ auto marked_signal = Dimension(36);+ auto symbol_s = std::make_shared<Symbol>();+ marked_signal.set_symbol(symbol_s);++ auto marked_batch = Dimension(4);+ auto symbol_b = std::make_shared<Symbol>();+ marked_batch.set_symbol(symbol_b);++ auto param_0 = std::make_shared<ov::op::v0::Parameter>(element::f32, PartialShape{marked_signal});+ auto signal_length = std::make_shared<op::v0::ShapeOf>(param_0);++ const auto in_data = std::make_shared<Parameter>(element::f32, PartialShape{marked_batch, 6, 13, 2});+ const auto window = std::make_shared<Parameter>(element::f32, PartialShape{7});+ const auto frame_size = Constant::create<int32_t>(element::i32, {}, {11});+ const auto frame_step = Constant::create<int32_t>(element::i32, {}, {3});++ const auto op = make_op(in_data, window, frame_size, frame_step, signal_length, center, normalized);+ EXPECT_EQ(op->get_output_size(), 1);++ const auto& output_shape = op->get_output_partial_shape(0);+ EXPECT_EQ(output_shape, (PartialShape{marked_batch, marked_signal}));++ EXPECT_EQ(output_shape[0].get_symbol(), symbol_b);+ EXPECT_EQ(output_shape[1].get_symbol(), symbol_s);+ EXPECT_NE(output_shape[0].get_symbol(), output_shape[1].get_symbol());+}++TEST_F(TypePropISTFTTest, data_incompatible_shape) {+ const auto window = std::make_shared<Parameter>(element::f32, PartialShape{8});+ const auto frame_size = std::make_shared<Parameter>(element::i64, PartialShape{});+ const auto frame_step = std::make_shared<Parameter>(element::i64, PartialShape{});+ {+ const auto in_data = std::make_shared<Parameter>(element::f32, PartialShape{-1, -1, -1, -1, -1});+ OV_EXPECT_THROW(std::ignore = make_op(in_data, window, frame_size, frame_step, center, normalized),+ NodeValidationFailure,+ HasSubstr("The shape of data must be 3D or 4D"));+ }+ {+ const auto in_data = std::make_shared<Parameter>(element::f32, PartialShape{-1, -1});+ OV_EXPECT_THROW(std::ignore = make_op(in_data, window, frame_size, frame_step, center, normalized),+ NodeValidationFailure,+ HasSubstr("The shape of data must be 3D or 4D"));+ }+}++TEST_F(TypePropISTFTTest, window_incompatible_shape) {+ const auto in_data = std::make_shared<Parameter>(element::f32, PartialShape{9, 3, 2});+ const auto frame_size = std::make_shared<Parameter>(element::i64, PartialShape{});+ const auto frame_step = std::make_shared<Parameter>(element::i64, PartialShape{});+ {+ const auto window = std::make_shared<Parameter>(element::f32, PartialShape{});+ OV_EXPECT_THROW(std::ignore = make_op(in_data, window, frame_size, frame_step, center, normalized),+ NodeValidationFailure,+ HasSubstr("The shape of window must be 1D [window_size]"));+ }+ {+ const auto window = std::make_shared<Parameter>(element::f32, PartialShape{2, 8});+ OV_EXPECT_THROW(std::ignore = make_op(in_data, window, frame_size, frame_step, center, normalized),+ NodeValidationFailure,+ HasSubstr("The shape of window must be 1D [window_size]"));+ }+}++TEST_F(TypePropISTFTTest, frame_size_incompatible_shape) {+ const auto in_data = std::make_shared<Parameter>(element::f32, PartialShape{9, 3, 2});+ const auto window = std::make_shared<Parameter>(element::f32, PartialShape{16});+ const auto frame_step = std::make_shared<Parameter>(element::i64, PartialShape{});+ {+ const auto frame_size = std::make_shared<Parameter>(element::i64, PartialShape{1});+ OV_EXPECT_THROW(std::ignore = make_op(in_data, window, frame_size, frame_step, center, normalized),+ NodeValidationFailure,+ HasSubstr("The shape of frame_size must be a scalar"));+ }+ {+ const auto frame_size = std::make_shared<Parameter>(element::i64, PartialShape{1, 2});+ OV_EXPECT_THROW(std::ignore = make_op(in_data, window, frame_size, frame_step, center, normalized),+ NodeValidationFailure,+ HasSubstr("The shape of frame_size must be a scalar"));+ }+}++TEST_F(TypePropISTFTTest, frame_step_incompatible_shape) {+ const auto in_data = std::make_shared<Parameter>(element::f32, PartialShape{9, 3, 2});+ const auto window = std::make_shared<Parameter>(element::f32, PartialShape{16});+ const auto frame_size = std::make_shared<Parameter>(element::i64, PartialShape{});+ {+ const auto frame_step = std::make_shared<Parameter>(element::i64, PartialShape{1});++ OV_EXPECT_THROW(std::ignore = make_op(in_data, window, frame_size, frame_step, center, normalized),+ NodeValidationFailure,+ HasSubstr("The shape of frame_step must be a scalar"));+ }+ {+ const auto frame_step = std::make_shared<Parameter>(element::i64, PartialShape{1, 2});+ OV_EXPECT_THROW(std::ignore = make_op(in_data, window, frame_size, frame_step, center, normalized),+ NodeValidationFailure,+ HasSubstr("The shape of frame_step must be a scalar"));+ }+}++TEST_F(TypePropISTFTTest, signal_length_incompatible_shape) {+ const auto in_data = std::make_shared<Parameter>(element::f32, PartialShape{9, 3, 2});+ const auto window = std::make_shared<Parameter>(element::f32, PartialShape{16});+ const auto frame_step = std::make_shared<Parameter>(element::i64, PartialShape{});+ const auto frame_size = std::make_shared<Parameter>(element::i64, PartialShape{});+ {+ const auto signal_length = std::make_shared<Parameter>(element::i64, PartialShape{1, 2});+ OV_EXPECT_THROW(+ std::ignore = make_op(in_data, window, frame_size, frame_step, signal_length, center, normalized),+ NodeValidationFailure,+ HasSubstr("The shape of 'signal_length' input must be a scalar or single element 1D tensor"));+ }+}++TEST_F(TypePropISTFTTest, data_incompatible_type) {+ const auto window = std::make_shared<Parameter>(element::f32, PartialShape{16});+ const auto frame_size = std::make_shared<Parameter>(element::i64, PartialShape{});+ const auto frame_step = std::make_shared<Parameter>(element::i64, PartialShape{});+ {+ const auto in_data = std::make_shared<Parameter>(element::i32, PartialShape{9, 3, 2});+ OV_EXPECT_THROW(std::ignore = make_op(in_data, window, frame_size, frame_step, center, normalized),+ NodeValidationFailure,+ HasSubstr("Expected floating point type of the 'data' input"));+ }+ {+ const auto in_data = std::make_shared<Parameter>(element::boolean, PartialShape{9, 3, 2});+ OV_EXPECT_THROW(std::ignore = make_op(in_data, window, frame_size, frame_step, center, normalized),+ NodeValidationFailure,+ HasSubstr("Expected floating point type of the 'data' input"));+ }+}++TEST_F(TypePropISTFTTest, window_incompatible_type) {+ const auto in_data = std::make_shared<Parameter>(element::f32, PartialShape{9, 3, 2});+ const auto frame_size = std::make_shared<Parameter>(element::i64, PartialShape{});+ const auto frame_step = std::make_shared<Parameter>(element::i64, PartialShape{});+ {+ const auto window = std::make_shared<Parameter>(element::i32, PartialShape{8});+ OV_EXPECT_THROW(+ std::ignore = make_op(in_data, window, frame_size, frame_step, center, normalized),+ NodeValidationFailure,+ HasSubstr("Expected floating point type of the 'window' input, matching the type of `data` input"));+ }+ {+ const auto window = std::make_shared<Parameter>(element::boolean, PartialShape{8});+ OV_EXPECT_THROW(+ std::ignore = make_op(in_data, window, frame_size, frame_step, center, normalized),+ NodeValidationFailure,+ HasSubstr("Expected floating point type of the 'window' input, matching the type of `data` input"));+ }+ {+ // Doesn't match the type of in_data+ const auto window = std::make_shared<Parameter>(element::f16, PartialShape{8});+ OV_EXPECT_THROW(+ std::ignore = make_op(in_data, window, frame_size, frame_step, center, normalized),+ NodeValidationFailure,+ HasSubstr("Expected floating point type of the 'window' input, matching the type of `data` input"));+ }+}++TEST_F(TypePropISTFTTest, frame_size_incompatible_type) {+ const auto in_data = std::make_shared<Parameter>(element::f32, PartialShape{9, 3, 2});+ const auto window = std::make_shared<Parameter>(element::f32, PartialShape{8});+ const auto frame_step = std::make_shared<Parameter>(element::i64, PartialShape{});+ {+ const auto frame_size = std::make_shared<Parameter>(element::f32, PartialShape{});+ OV_EXPECT_THROW(std::ignore = make_op(in_data, window, frame_size, frame_step, center, normalized),+ NodeValidationFailure,+ HasSubstr("Expected i32 or i64 type of the input at port: 2"));+ }+ {+ const auto frame_size = std::make_shared<Parameter>(element::i8, PartialShape{});+ OV_EXPECT_THROW(std::ignore = make_op(in_data, window, frame_size, frame_step, center, normalized),+ NodeValidationFailure,+ HasSubstr("Expected i32 or i64 type of the input at port: 2"));+ }+}++TEST_F(TypePropISTFTTest, frame_step_incompatible_type) {+ const auto in_data = std::make_shared<Parameter>(element::f32, PartialShape{9, 3, 2});+ const auto window = std::make_shared<Parameter>(element::f32, PartialShape{8});+ const auto frame_size = std::make_shared<Parameter>(element::i64, PartialShape{});+ {+ const auto frame_step = std::make_shared<Parameter>(element::f32, PartialShape{});++ OV_EXPECT_THROW(std::ignore = make_op(in_data, window, frame_size, frame_step, center, normalized),+ NodeValidationFailure,+ HasSubstr("Expected i32 or i64 type of the input at port: 3"));+ }+ {+ const auto frame_step = std::make_shared<Parameter>(element::i8, PartialShape{});+ OV_EXPECT_THROW(std::ignore = make_op(in_data, window, frame_size, frame_step, center, normalized),+ NodeValidationFailure,+ HasSubstr("Expected i32 or i64 type of the input at port: 3"));+ }+}++TEST_F(TypePropISTFTTest, frame_step_incompatible_value) {+ const auto signal = std::make_shared<Parameter>(element::f32, PartialShape{9, 9, 2});+ const auto window = std::make_shared<Parameter>(element::f32, PartialShape{8});+ const auto frame_size = Constant::create<int32_t>(element::i32, {}, {8});+ {+ const auto frame_step = Constant::create<int32_t>(element::i32, {}, {-1});+ OV_EXPECT_THROW(std::ignore = make_op(signal, window, frame_size, frame_step, center, normalized),+ NodeValidationFailure,+ HasSubstr("Provided frame step must be greater than zero, but got: -1"));+ }+}++TEST_F(TypePropISTFTTest, frame_size_incompatible_value) {+ const auto signal = std::make_shared<Parameter>(element::f32, PartialShape{9, 9, 2});+ const auto window = std::make_shared<Parameter>(element::f32, PartialShape{8});+ const auto frame_step = Constant::create<int32_t>(element::i32, {}, {3});++ {+ const auto frame_size = Constant::create<int32_t>(element::i32, {}, {-1});+ OV_EXPECT_THROW(std::ignore = make_op(signal, window, frame_size, frame_step, center, normalized),+ NodeValidationFailure,+ HasSubstr("Provided frame size must be greater than zero, but got: -1"));+ }+}++TEST_F(TypePropISTFTTest, window_incompatible_dim_with_frame_size) {+ const auto signal = std::make_shared<Parameter>(element::f32, PartialShape{9, 9, 2});+ const auto window = std::make_shared<Parameter>(element::f32, PartialShape{16});+ const auto frame_size = Constant::create<int32_t>(element::i32, {}, {8});+ const auto frame_step = Constant::create<int32_t>(element::i32, {}, {4});+ OV_EXPECT_THROW(std::ignore = make_op(signal, window, frame_size, frame_step, center, normalized),+ NodeValidationFailure,+ HasSubstr("Window input dimension must be in range [1, 8]"));+}++} // namespace ov::testdiff --git a/src/core/tests/visitors/op/istft.cpp b/src/core/tests/visitors/op/istft.cppnew file mode 100644index 00000000000..a5cf82aa144--- /dev/null+++ b/src/core/tests/visitors/op/istft.cpp@@ -0,0 +1,57 @@+// Copyright (C) 2018-2025 Intel Corporation+// SPDX-License-Identifier: Apache-2.0+//++#include "openvino/op/istft.hpp"++#include <gtest/gtest.h>++#include "openvino/op/constant.hpp"+#include "openvino/op/parameter.hpp"+#include "visitors/visitors.hpp"++namespace ov::test {+using op::v0::Parameter, op::v0::Constant;++TEST(attributes, istft) {+ NodeBuilder::opset().insert<ov::op::v16::ISTFT>();+ const auto data = std::make_shared<Parameter>(ov::element::f32, ov::PartialShape{9, 9, 3});+ const auto window = std::make_shared<Parameter>(ov::element::f32, ov::PartialShape{16});+ const auto frame_size = Constant::create<int32_t>(ov::element::i32, {}, {16});+ const auto step_size = Constant::create<int32_t>(ov::element::i32, {}, {4});++ constexpr bool center = true;+ constexpr bool normalized = true;+ const auto op = std::make_shared<ov::op::v16::ISTFT>(data, window, frame_size, step_size, center, normalized);++ NodeBuilder builder(op, {data, window, frame_size, step_size});+ auto g_op = ov::as_type_ptr<ov::op::v16::ISTFT>(builder.create());++ constexpr auto expected_attr_count = 2;+ EXPECT_EQ(builder.get_value_map_size(), expected_attr_count);+ EXPECT_EQ(op->get_center(), g_op->get_center());+ EXPECT_EQ(op->get_normalized(), g_op->get_normalized());+}++TEST(attributes, istft_with_length) {+ NodeBuilder::opset().insert<ov::op::v16::ISTFT>();+ const auto data = std::make_shared<Parameter>(ov::element::f32, ov::PartialShape{9, 9, 3});+ const auto window = std::make_shared<Parameter>(ov::element::f32, ov::PartialShape{16});+ const auto frame_size = Constant::create<int32_t>(ov::element::i32, {}, {16});+ const auto step_size = Constant::create<int32_t>(ov::element::i32, {}, {4});+ const auto signal_length = Constant::create<int32_t>(ov::element::i32, {}, {42});++ constexpr bool center = true;+ constexpr bool normalized = true;+ const auto op =+ std::make_shared<ov::op::v16::ISTFT>(data, window, frame_size, step_size, signal_length, center, normalized);++ NodeBuilder builder(op, {data, window, frame_size, step_size});+ auto g_op = ov::as_type_ptr<ov::op::v16::ISTFT>(builder.create());++ constexpr auto expected_attr_count = 2;+ EXPECT_EQ(builder.get_value_map_size(), expected_attr_count);+ EXPECT_EQ(op->get_center(), g_op->get_center());+ EXPECT_EQ(op->get_normalized(), g_op->get_normalized());+}+} // namespace ov::testdiff --git a/src/plugins/template/backend/ops/istft.cpp b/src/plugins/template/backend/ops/istft.cppnew file mode 100644index 00000000000..3561bd242e8--- /dev/null+++ b/src/plugins/template/backend/ops/istft.cpp@@ -0,0 +1,66 @@+// Copyright (C) 2018-2025 Intel Corporation+// SPDX-License-Identifier: Apache-2.0+//++#include "openvino/reference/istft.hpp"++#include "evaluate_node.hpp"+#include "evaluates_map.hpp"+#include "istft_shape_inference.hpp"+#include "openvino/reference/fft.hpp"+#include "openvino/runtime/tensor.hpp"++template <ov::element::Type_t ET>+bool evaluate(const std::shared_ptr<ov::op::v16::ISTFT>& op,+ ov::TensorVector& outputs,+ const ov::TensorVector& inputs) {+ OPENVINO_ASSERT(outputs.size() == 1);++ const auto input_shapes = ov::util::get_tensors_partial_shapes(inputs);+ const auto output_shape =+ ov::op::v16::shape_infer(op.get(), input_shapes, make_tensor_accessor(inputs)).front().to_shape();++ outputs[0].set_shape(output_shape);++ const auto frame_size = ov::get_tensor_data_as<int64_t>(inputs[2]).front();+ const auto frame_step = ov::get_tensor_data_as<int64_t>(inputs[3]).front();+ int64_t length = -1;+ if (inputs.size() == 5) {+ length = ov::get_tensor_data_as<int64_t>(inputs[4]).front();+ }++ const std::vector<float> data_f32 = get_floats(inputs[0], inputs[0].get_shape());+ const std::vector<float> window_f32 = get_floats(inputs[1], inputs[1].get_shape());+ std::vector<float> result_f32(ov::shape_size(output_shape), 0.f);++ ov::reference::istft(data_f32.data(),+ window_f32.data(),+ result_f32.data(),+ inputs[0].get_shape(),+ inputs[1].get_shape(),+ frame_size,+ frame_step,+ length,+ op->get_center(),+ op->get_normalized());++ const auto& output_type = op->get_input_element_type(0);+ ov::reference::fft_postprocessing(outputs, output_type, result_f32);+ return true;+}++template <>+bool evaluate_node<ov::op::v16::ISTFT>(std::shared_ptr<ov::Node> node,+ ov::TensorVector& outputs,+ const ov::TensorVector& inputs) {+ switch (node->get_input_element_type(0)) {+ case ov::element::bf16:+ return evaluate<ov::element::bf16>(ov::as_type_ptr<ov::op::v16::ISTFT>(node), outputs, inputs);+ case ov::element::f16:+ return evaluate<ov::element::f16>(ov::as_type_ptr<ov::op::v16::ISTFT>(node), outputs, inputs);+ case ov::element::f32:+ return evaluate<ov::element::f32>(ov::as_type_ptr<ov::op::v16::ISTFT>(node), outputs, inputs);+ default:+ OPENVINO_THROW("Unhandled data type ", node->get_input_element_type(0), " in evaluate_node()");+ }+}diff --git a/src/plugins/template/backend/ops/ops_evaluates.hpp b/src/plugins/template/backend/ops/ops_evaluates.hppindex f350048fb77..265967afbad 100644--- a/src/plugins/template/backend/ops/ops_evaluates.hpp+++ b/src/plugins/template/backend/ops/ops_evaluates.hpp@@ -527,6 +527,10 @@ extern template bool evaluate_node<ov::op::v15::STFT>(std::shared_ptr<ov::Node>ov::TensorVector& outputs,const ov::TensorVector& inputs);+extern template bool evaluate_node<ov::op::v16::ISTFT>(std::shared_ptr<ov::Node> node,+ ov::TensorVector& outputs,+ const ov::TensorVector& inputs);+extern template bool evaluate_node<ov::op::internal::AUGRUCell>(std::shared_ptr<ov::Node> node,ov::TensorVector& outputs,const ov::TensorVector& inputs);diff --git a/src/plugins/template/backend/opset_int_tbl.hpp b/src/plugins/template/backend/opset_int_tbl.hppindex 4bc7283faed..4a9ad0b6af1 100644--- a/src/plugins/template/backend/opset_int_tbl.hpp+++ b/src/plugins/template/backend/opset_int_tbl.hpp@@ -176,6 +176,7 @@ _OPENVINO_OP_REG(SliceScatter, ov::op::v15)_OPENVINO_OP_REG(SearchSorted, ov::op::v15)_OPENVINO_OP_REG(Identity, ov::op::v16)+_OPENVINO_OP_REG(ISTFT, ov::op::v16)_OPENVINO_OP_REG(AUGRUCell, ov::op::internal)_OPENVINO_OP_REG(AUGRUSequence, ov::op::internal)diff --git a/src/plugins/template/tests/functional/op_reference/istft.cpp b/src/plugins/template/tests/functional/op_reference/istft.cppnew file mode 100644index 00000000000..e23ec3bd5cb--- /dev/null+++ b/src/plugins/template/tests/functional/op_reference/istft.cpp@@ -0,0 +1,699 @@+// Copyright (C) 2018-2025 Intel Corporation+// SPDX-License-Identifier: Apache-2.0+//++#include "openvino/op/istft.hpp"++#include "base_reference_test.hpp"+#include "gtest/gtest.h"+#include "openvino/op/parameter.hpp"++namespace {+using ov::Shape;+struct ISTFTParams {+ ISTFTParams(const reference_tests::Tensor& signal,+ const reference_tests::Tensor& window,+ const reference_tests::Tensor& frame_size,+ const reference_tests::Tensor& frame_step,+ const reference_tests::Tensor& length,+ bool center,+ bool normalized,+ const reference_tests::Tensor& expected_tensor,+ std::string name)+ : signal{signal},+ window{window},+ frame_size{frame_size},+ frame_step{frame_step},+ length{length},+ center{center},+ normalized{normalized},+ expected_tensor(expected_tensor),+ test_case_name{std::move(name)} {}++ reference_tests::Tensor signal;+ reference_tests::Tensor window;+ reference_tests::Tensor frame_size;+ reference_tests::Tensor frame_step;+ reference_tests::Tensor length;++ bool center;+ bool normalized;++ reference_tests::Tensor expected_tensor;+ std::string test_case_name;+};++class ReferenceISTFT : public testing::TestWithParam<ISTFTParams>, public reference_tests::CommonReferenceTest {+public:+ void SetUp() override {+ const auto& params = GetParam();+ function = CreateFunction(params);+ if (shape_size(params.length.shape) == 0) { // Ignore signal length+ inputData = {params.signal.data, params.window.data, params.frame_size.data, params.frame_step.data};+ } else {+ inputData = {params.signal.data,+ params.window.data,+ params.frame_size.data,+ params.frame_step.data,+ params.length.data};+ }++ refOutData = {params.expected_tensor.data};+ abs_threshold = 1e-5f;+ }++ static std::string getTestCaseName(const testing::TestParamInfo<ISTFTParams>& obj) {+ std::ostringstream name;+ name << obj.param.test_case_name;+ name << "_signal_input_type_";+ name << obj.param.signal.type;+ name << "_signal_shape_";+ name << obj.param.signal.shape;+ name << "_window_input_type_";+ name << obj.param.window.type;+ name << "_window_shape_";+ name << obj.param.window.shape;+ name << "_frame_size_input_type_";+ name << obj.param.frame_size.type;+ name << "_frame_size_shape_";+ name << obj.param.frame_size.shape;+ name << "_frame_step_input_type_";+ name << obj.param.frame_step.type;+ name << "_frame_step_shape_";+ name << obj.param.frame_step.shape;+ name << "_length_input_type_";+ name << obj.param.frame_step.type;+ name << "_length_shape_";+ name << obj.param.frame_step.shape;+ name << "_center_";+ name << obj.param.center;+ name << "_normalized_";+ name << obj.param.normalized;+ return name.str();+ }++private:+ static std::shared_ptr<ov::Model> CreateFunction(const ISTFTParams& params) {+ const auto in_signal = std::make_shared<ov::op::v0::Parameter>(params.signal.type, params.signal.shape);+ const auto in_window = std::make_shared<ov::op::v0::Parameter>(params.window.type, params.window.shape);+ const auto in_frame_size =+ std::make_shared<ov::op::v0::Parameter>(params.frame_size.type, params.frame_size.shape);+ const auto in_frame_step =+ std::make_shared<ov::op::v0::Parameter>(params.frame_step.type, params.frame_step.shape);+ const auto in_length = std::make_shared<ov::op::v0::Parameter>(params.length.type, params.length.shape);++ std::shared_ptr<ov::op::v16::ISTFT> ISTFT;+ if (shape_size(params.length.shape) == 0) {+ ISTFT = std::make_shared<ov::op::v16::ISTFT>(in_signal,+ in_window,+ in_frame_size,+ in_frame_step,+ params.center,+ params.normalized);+ return std::make_shared<ov::Model>(ISTFT->outputs(),+ ov::ParameterVector{in_signal, in_window, in_frame_size, in_frame_step});+ } else {+ ISTFT = std::make_shared<ov::op::v16::ISTFT>(in_signal,+ in_window,+ in_frame_size,+ in_frame_step,+ in_length,+ params.center,+ params.normalized);+ return std::make_shared<ov::Model>(+ ISTFT->outputs(),+ ov::ParameterVector{in_signal, in_window, in_frame_size, in_frame_step, in_length});+ }+ }+};++template <ov::element::Type_t ET, ov::element::Type_t IT = ov::element::i64>+std::vector<ISTFTParams> generateISTFTParams() {+ using VT = typename ov::element_type_traits<ET>::value_type;+ using INT_T = typename ov::element_type_traits<IT>::value_type;++ const ov::Shape signal_48_shape{48};+ const ov::Shape signal_39_shape{39};+ const ov::Shape signal_1_48_shape{1, 48};+ const ov::Shape signal_2_48_shape{2, 48};+ const ov::Shape signal_256_shape{1, 256};++ const ov::Shape signal_16_shape{16};++ reference_tests::Tensor signal_16(signal_16_shape,+ ET,+ std::vector<VT>{5.8779e-01,+ -7.7051e-01,+ -6.8455e-01,+ 6.8455e-01,+ 7.7051e-01,+ -5.8779e-01,+ -8.4433e-01,+ 4.8175e-01,+ 9.0483e-01,+ -3.6813e-01,+ -9.5106e-01,+ 2.4869e-01,+ 9.8229e-01,+ -1.2533e-01,+ -9.9803e-01,+ 6.8545e-07});++ reference_tests::Tensor signal_48(+ signal_48_shape,+ ET,+ std::vector<VT>{-0.9511, -0.1861, 0.7722, 0.9283, 0.1200, -0.8129, -0.9014, -0.0534, 0.8500, 0.8704,+ -0.0134, -0.8833, -0.8356, 0.0801, 0.9126, 0.7971, -0.1465, -0.9379, -0.7550, 0.2123,+ 0.9590, 0.7095, -0.2771, -0.9758, -0.6608, 0.3406, 0.9882, 0.6092, -0.4027, -0.9962,+ -0.5549, 0.4629, 0.9998, 0.4981, -0.5211, -0.9989, -0.4390, 0.5769, 0.9936, 0.3780,+ -0.6302, -0.9838, -0.3154, 0.6806, 0.9696, 0.2513, -0.7281, -0.9511});++ reference_tests::Tensor signal_48_pad_0_to_55(+ Shape{55},+ ET,+ std::vector<VT>{-0.9511, -0.1861, 0.7722, 0.9283, 0.1200, -0.8129, -0.9014, -0.0534, 0.8500, 0.8704,+ -0.0134, -0.8833, -0.8356, 0.0801, 0.9126, 0.7971, -0.1465, -0.9379, -0.7550, 0.2123,+ 0.9590, 0.7095, -0.2771, -0.9758, -0.6608, 0.3406, 0.9882, 0.6092, -0.4027, -0.9962,+ -0.5549, 0.4629, 0.9998, 0.4981, -0.5211, -0.9989, -0.4390, 0.5769, 0.9936, 0.3780,+ -0.6302, -0.9838, -0.3154, 0.6806, 0.9696, 0.2513, -0.7281, -0.9511, 0.0000, 0.0000,+ 0.0000, 0.0000, 0.0000, 0.0000, 0.0000});++ reference_tests::Tensor signal_39(+ signal_39_shape,+ ET,+ std::vector<VT>{-0.9511, -0.1861, 0.7722, 0.9283, 0.1200, -0.8129, -0.9014, -0.0534, 0.8500, 0.8704,+ -0.0134, -0.8833, -0.8356, 0.0801, 0.9126, 0.7971, -0.1465, -0.9379, -0.7550, 0.2123,+ 0.9590, 0.7095, -0.2771, -0.9758, -0.6608, 0.3406, 0.9882, 0.6092, -0.4027, -0.9962,+ -0.5549, 0.4629, 0.9998, 0.4981, -0.5211, -0.9989, -0.4390, 0.5769, 0.9936});++ reference_tests::Tensor signal_55(+ Shape{55},+ ET,+ std::vector<VT>{-0.9511, -0.1861, 0.7722, 0.9283, 0.1200, -0.8129, -0.9014, -0.0534, 0.8500, 0.8704,+ -0.0134, -0.8833, -0.8356, 0.0801, 0.9126, 0.7971, -0.1465, -0.9379, -0.7550, 0.2123,+ 0.9590, 0.7095, -0.2771, -0.9758, -0.6608, 0.3406, 0.9882, 0.6092, -0.4027, -0.9962,+ -0.5549, 0.4629, 0.9998, 0.4981, -0.5211, -0.9989, -0.4390, 0.5769, 0.9936, 0.3780,+ -0.6302, -0.9838, -0.3154, 0.6806, 0.9696, 0.2513, -0.7281, -0.9511, -0.7281, 0.2513,+ 0.9696, 0.6806, -0.3154, -0.9838, -0.6302});++ reference_tests::Tensor signal_60(+ Shape{60},+ ET,+ std::vector<VT>{-0.9511, -0.1861, 0.7722, 0.9283, 0.1200, -0.8129, -0.9014, -0.0534, 0.8500, 0.8704,+ -0.0134, -0.8833, -0.8356, 0.0801, 0.9126, 0.7971, -0.1465, -0.9379, -0.7550, 0.2123,+ 0.9590, 0.7095, -0.2771, -0.9758, -0.6608, 0.3406, 0.9882, 0.6092, -0.4027, -0.9962,+ -0.5549, 0.4629, 0.9998, 0.4981, -0.5211, -0.9989, -0.4390, 0.5769, 0.9936, 0.3780,+ -0.6302, -0.9838, -0.3154, 0.6806, 0.9696, 0.2513, -0.7281, -0.9511, -0.7281, 0.2513,+ 0.9696, 0.6806, -0.3154, -0.9838, -0.6302, 0.3780, 0.0000, 0.0000, 0.0000, 0.0000});++ reference_tests::Tensor signal_1_48(+ signal_1_48_shape,+ ET,+ std::vector<VT>{-0.9511, -0.1861, 0.7722, 0.9283, 0.1200, -0.8129, -0.9014, -0.0534, 0.8500, 0.8704,+ -0.0134, -0.8833, -0.8356, 0.0801, 0.9126, 0.7971, -0.1465, -0.9379, -0.7550, 0.2123,+ 0.9590, 0.7095, -0.2771, -0.9758, -0.6608, 0.3406, 0.9882, 0.6092, -0.4027, -0.9962,+ -0.5549, 0.4629, 0.9998, 0.4981, -0.5211, -0.9989, -0.4390, 0.5769, 0.9936, 0.3780,+ -0.6302, -0.9838, -0.3154, 0.6806, 0.9696, 0.2513, -0.7281, -0.9511});++ reference_tests::Tensor signal_2_48(+ signal_2_48_shape,+ ET,+ std::vector<VT>{+ -0.9511, -0.1861, 0.7722, 0.9283, 0.1200, -0.8129, -0.9014, -0.0534, 0.8500, 0.8704, -0.0134, -0.8833,+ -0.8356, 0.0801, 0.9126, 0.7971, -0.1465, -0.9379, -0.7550, 0.2123, 0.9590, 0.7095, -0.2771, -0.9758,+ -0.6608, 0.3406, 0.9882, 0.6092, -0.4027, -0.9962, -0.5549, 0.4629, 0.9998, 0.4981, -0.5211, -0.9989,+ -0.4390, 0.5769, 0.9936, 0.3780, -0.6302, -0.9838, -0.3154, 0.6806, 0.9696, 0.2513, -0.7281, -0.9511,+ -0.9511, -0.1861, 0.7722, 0.9283, 0.1200, -0.8129, -0.9014, -0.0534, 0.8500, 0.8704, -0.0134, -0.8833,+ -0.8356, 0.0801, 0.9126, 0.7971, -0.1465, -0.9379, -0.7550, 0.2123, 0.9590, 0.7095, -0.2771, -0.9758,+ -0.6608, 0.3406, 0.9882, 0.6092, -0.4027, -0.9962, -0.5549, 0.4629, 0.9998, 0.4981, -0.5211, -0.9989,+ -0.4390, 0.5769, 0.9936, 0.3780, -0.6302, -0.9838, -0.3154, 0.6806, 0.9696, 0.2513, -0.7281, -0.9511});++ reference_tests::Tensor ones_window_16(Shape{16}, ET, std::vector<VT>(16, 1.f));+ reference_tests::Tensor two_window_16(Shape{16}, ET, std::vector<VT>(16, 2.f));++ reference_tests::Tensor hann_window_5(Shape{5}, ET, std::vector<VT>{0., 0.5, 1., 0.5, 0.});+ reference_tests::Tensor hann_window_7(Shape{7}, ET, std::vector<VT>{0., 0.25, 0.75, 1., 0.75, 0.25, 0.});+ reference_tests::Tensor hann_window_8(+ Shape{8},+ ET,+ std::vector<VT>{0., 0.18826, 0.61126, 0.95048, 0.95048, 0.61126, 0.18826, 0.});+ reference_tests::Tensor hann_window_10(+ Shape{10},+ ET,+ std::vector<VT>{0., 0.11698, 0.41318, 0.75, 0.96985, 0.96985, 0.75, 0.41318, 0.11698, 0.});+ reference_tests::Tensor hann_window_16(Shape{16},+ ET,+ std::vector<VT>{0.,+ 0.04323,+ 0.16543,+ 0.34549,+ 0.55226,+ 0.75,+ 0.90451,+ 0.98907,+ 0.98907,+ 0.90451,+ 0.75,+ 0.55226,+ 0.34549,+ 0.16543,+ 0.04323,+ 0.});++ reference_tests::Tensor hann_window_period_16(Shape{16},+ ET,+ std::vector<VT>{0.0000,+ 0.0381,+ 0.1464,+ 0.3087,+ 0.5000,+ 0.6913,+ 0.8536,+ 0.9619,+ 1.0000,+ 0.9619,+ 0.8536,+ 0.6913,+ 0.5000,+ 0.3087,+ 0.1464,+ 0.0381});++ reference_tests::Tensor frame_size_8(Shape{}, IT, std::vector<INT_T>{8});+ reference_tests::Tensor frame_size_9(Shape{}, IT, std::vector<INT_T>{9});+ reference_tests::Tensor frame_size_11(Shape{}, IT, std::vector<INT_T>{11});+ reference_tests::Tensor frame_size_16(Shape{}, IT, std::vector<INT_T>{16});++ reference_tests::Tensor frame_step_2(Shape{}, IT, std::vector<INT_T>{2});+ reference_tests::Tensor frame_step_3(Shape{}, IT, std::vector<INT_T>{3});+ reference_tests::Tensor frame_step_4(Shape{}, IT, std::vector<INT_T>{4});+ reference_tests::Tensor frame_step_8(Shape{}, IT, std::vector<INT_T>{8});+ reference_tests::Tensor frame_step_12(Shape{}, IT, std::vector<INT_T>{12});+ reference_tests::Tensor frame_step_16(Shape{}, IT, std::vector<INT_T>{16});+ reference_tests::Tensor frame_step_100(Shape{}, IT, std::vector<INT_T>{100});++ reference_tests::Tensor output_stft_9_1_2_transp_win_one(Shape{9, 1, 2},+ ET,+ std::vector<VT>{-0.6693,+ 0.0000,+ -0.7103,+ -0.0912,+ -0.8803,+ -0.2251,+ -1.5651,+ -0.5924,+ 6.7234,+ 3.2667,+ 0.7715,+ 0.4254,+ 0.3599,+ 0.1884,+ 0.2358,+ 0.0796,+ 0.2042,+ 0.0000});++ reference_tests::Tensor output_stft_9_1_2_transp_win_two(Shape{9, 1, 2},+ ET,+ std::vector<VT>{-1.3386,+ 0.0000,+ -1.4207,+ -0.1823,+ -1.7606,+ -0.4502,+ -3.1302,+ -1.1848,+ 13.4467,+ 6.5335,+ 1.5429,+ 0.8508,+ 0.7199,+ 0.3768,+ 0.4716,+ 0.1591,+ 0.4084,+ 0.0000});++ reference_tests::Tensor output_stft_9_3_2_transp_win_two(+ Shape{9, 3, 2},+ ET,+ std::vector<VT>{1.3873, 0.0000, -2.8503, 0.0000, -0.4391, 0.0000, 1.7637, -0.6945, -3.1429,+ -0.9896, -0.7182, 1.0237, 4.2213, -2.5114, -5.0535, -3.5783, -2.5402, 3.7017,+ -12.4337, 7.5925, 7.8944, 10.8180, 9.8076, -11.1912, -3.1735, 1.6741, 0.6953,+ 2.3853, 2.9422, -2.4676, -2.1233, 0.8610, -0.1211, 1.2268, 2.1636, -1.2691,+ -1.7631, 0.4790, -0.4011, 0.6825, 1.8965, -0.7060, -1.6151, 0.2192, -0.5161,+ 0.3123, 1.7869, -0.3231, -1.5735, 0.0000, -0.5485, 0.0000, 1.7559, 0.0000});++ reference_tests::Tensor output_stft_2_9_3_2_transp_win_two(+ Shape{2, 9, 3, 2},+ ET,+ std::vector<VT>{1.3873, 0.0000, -2.8503, 0.0000, -0.4391, 0.0000, 1.7637, -0.6945, -3.1429, -0.9896,+ -0.7182, 1.0237, 4.2213, -2.5114, -5.0535, -3.5783, -2.5402, 3.7017, -12.4337, 7.5925,+ 7.8944, 10.8180, 9.8076, -11.1912, -3.1735, 1.6741, 0.6953, 2.3853, 2.9422, -2.4676,+ -2.1233, 0.8610, -0.1211, 1.2268, 2.1636, -1.2691, -1.7631, 0.4790, -0.4011, 0.6825,+ 1.8965, -0.7060, -1.6151, 0.2192, -0.5161, 0.3123, 1.7869, -0.3231, -1.5735, 0.0000,+ -0.5485, 0.0000, 1.7559, 0.0000, 1.3873, 0.0000, -2.8503, 0.0000, -0.4391, 0.0000,+ 1.7637, -0.6945, -3.1429, -0.9896, -0.7182, 1.0237, 4.2213, -2.5114, -5.0535, -3.5783,+ -2.5402, 3.7017, -12.4337, 7.5925, 7.8944, 10.8180, 9.8076, -11.1912, -3.1735, 1.6741,+ 0.6953, 2.3853, 2.9422, -2.4676, -2.1233, 0.8610, -0.1211, 1.2268, 2.1636, -1.2691,+ -1.7631, 0.4790, -0.4011, 0.6825, 1.8965, -0.7060, -1.6151, 0.2192, -0.5161, 0.3123,+ 1.7869, -0.3231, -1.5735, 0.0000, -0.5485, 0.0000, 1.7559, 0.0000});++ reference_tests::Tensor output_stft_9_4_2_transp_win_two_center(+ Shape{9, 4, 2},+ ET,+ std::vector<VT>{+ -7.3526e-01, 0.0000e+00, 1.1330e+00, 0.0000e+00, 2.5475e+00, 0.0000e+00, -4.1695e+00, 0.0000e+00,+ -3.3068e+00, 2.3842e-07, 1.0681e+00, 1.3042e+00, 2.9902e+00, -2.6441e-02, -2.2545e+00, -9.3384e-01,+ -1.6860e+00, 0.0000e+00, 6.4448e-01, 4.7161e+00, 5.8809e+00, -9.5572e-02, -6.7604e+00, -6.7604e+00,+ 1.4974e+01, 0.0000e+00, 3.5154e+00, -1.4258e+01, -1.3709e+01, 2.8896e-01, 4.2285e+00, 1.0209e+01,+ 7.9468e-01, 0.0000e+00, 1.9192e+00, -3.1437e+00, -2.8170e+00, 6.3723e-02, 0.0000e+00, 4.5065e+00,+ 1.6981e+00, 0.0000e+00, 1.7382e+00, -1.6169e+00, -1.5818e+00, 3.2759e-02, -4.7954e-01, 1.1577e+00,+ 3.2156e-01, 0.0000e+00, 1.6761e+00, -8.9949e-01, -1.1581e+00, 1.8237e-02, -1.2894e+00, 1.2894e+00,+ 1.0437e+00, 2.3842e-07, 1.6506e+00, -4.1167e-01, -9.8408e-01, 8.3490e-03, -7.1159e-01, 2.9475e-01,+ 2.5795e-01, 0.0000e+00, 1.6434e+00, 0.0000e+00, -9.3507e-01, 0.0000e+00, -1.4628e+00, 0.0000e+00});++ reference_tests::Tensor output_stft_2_9_4_2_transp_win_two_center(+ Shape{2, 9, 4, 2},+ ET,+ std::vector<VT>{+ -7.3526e-01, 0.0000e+00, 1.1330e+00, 0.0000e+00, 2.5475e+00, 0.0000e+00, -4.1695e+00, 0.0000e+00,+ -3.3068e+00, 2.3842e-07, 1.0681e+00, 1.3042e+00, 2.9902e+00, -2.6441e-02, -2.2545e+00, -9.3384e-01,+ -1.6860e+00, 0.0000e+00, 6.4448e-01, 4.7161e+00, 5.8809e+00, -9.5572e-02, -6.7604e+00, -6.7604e+00,+ 1.4974e+01, 0.0000e+00, 3.5154e+00, -1.4258e+01, -1.3709e+01, 2.8896e-01, 4.2285e+00, 1.0209e+01,+ 7.9468e-01, 0.0000e+00, 1.9192e+00, -3.1437e+00, -2.8170e+00, 6.3723e-02, 0.0000e+00, 4.5065e+00,+ 1.6981e+00, 0.0000e+00, 1.7382e+00, -1.6169e+00, -1.5818e+00, 3.2759e-02, -4.7954e-01, 1.1577e+00,+ 3.2156e-01, 0.0000e+00, 1.6761e+00, -8.9949e-01, -1.1581e+00, 1.8237e-02, -1.2894e+00, 1.2894e+00,+ 1.0437e+00, 2.3842e-07, 1.6506e+00, -4.1167e-01, -9.8408e-01, 8.3490e-03, -7.1159e-01, 2.9475e-01,+ 2.5795e-01, 0.0000e+00, 1.6434e+00, 0.0000e+00, -9.3507e-01, 0.0000e+00, -1.4628e+00, 0.0000e+00,+ -7.3526e-01, 0.0000e+00, 1.1330e+00, 0.0000e+00, 2.5475e+00, 0.0000e+00, -4.1695e+00, 0.0000e+00,+ -3.3068e+00, 2.3842e-07, 1.0681e+00, 1.3042e+00, 2.9902e+00, -2.6441e-02, -2.2545e+00, -9.3384e-01,+ -1.6860e+00, 0.0000e+00, 6.4448e-01, 4.7161e+00, 5.8809e+00, -9.5572e-02, -6.7604e+00, -6.7604e+00,+ 1.4974e+01, 0.0000e+00, 3.5154e+00, -1.4258e+01, -1.3709e+01, 2.8896e-01, 4.2285e+00, 1.0209e+01,+ 7.9468e-01, 0.0000e+00, 1.9192e+00, -3.1437e+00, -2.8170e+00, 6.3723e-02, 0.0000e+00, 4.5065e+00,+ 1.6981e+00, 0.0000e+00, 1.7382e+00, -1.6169e+00, -1.5818e+00, 3.2759e-02, -4.7954e-01, 1.1577e+00,+ 3.2156e-01, 0.0000e+00, 1.6761e+00, -8.9949e-01, -1.1581e+00, 1.8237e-02, -1.2894e+00, 1.2894e+00,+ 1.0437e+00, 2.3842e-07, 1.6506e+00, -4.1167e-01, -9.8408e-01, 8.3490e-03, -7.1159e-01, 2.9475e-01,+ 2.5795e-01, 0.0000e+00, 1.6434e+00, 0.0000e+00, -9.3507e-01, 0.0000e+00, -1.4628e+00, 0.0000e+00});++ reference_tests::Tensor output_stft_9_4_2_transp_win_two_center_norm(+ Shape{9, 4, 2},+ ET,+ std::vector<VT>{+ -1.8382e-01, 0.0000e+00, 2.8325e-01, 0.0000e+00, 6.3686e-01, 0.0000e+00, -1.0424e+00, 0.0000e+00,+ -8.2669e-01, 5.9605e-08, 2.6703e-01, 3.2606e-01, 7.4754e-01, -6.6102e-03, -5.6362e-01, -2.3346e-01,+ -4.2149e-01, 0.0000e+00, 1.6112e-01, 1.1790e+00, 1.4702e+00, -2.3893e-02, -1.6901e+00, -1.6901e+00,+ 3.7434e+00, 0.0000e+00, 8.7886e-01, -3.5645e+00, -3.4273e+00, 7.2241e-02, 1.0571e+00, 2.5522e+00,+ 1.9867e-01, 0.0000e+00, 4.7980e-01, -7.8593e-01, -7.0426e-01, 1.5931e-02, 0.0000e+00, 1.1266e+00,+ 4.2452e-01, 0.0000e+00, 4.3454e-01, -4.0423e-01, -3.9546e-01, 8.1899e-03, -1.1988e-01, 2.8943e-01,+ 8.0389e-02, 0.0000e+00, 4.1901e-01, -2.2487e-01, -2.8953e-01, 4.5592e-03, -3.2235e-01, 3.2235e-01,+ 2.6093e-01, 5.9605e-08, 4.1264e-01, -1.0292e-01, -2.4602e-01, 2.0872e-03, -1.7790e-01, 7.3688e-02,+ 6.4488e-02, 0.0000e+00, 4.1084e-01, 0.0000e+00, -2.3377e-01, 0.0000e+00, -3.6569e-01, 0.0000e+00});++ reference_tests::Tensor output_stft_9_5_2_transp_win_hann_period_center_norm(+ Shape{9, 5, 2},+ ET,+ std::vector<VT>{1.6072e-01, 0.0000e+00, 2.3125e-02, 0.0000e+00, 1.8288e-02, 0.0000e+00, 1.2149e-02,+ 0.0000e+00, -1.1969e-01, 0.0000e+00, -1.3101e-01, -2.9802e-08, 6.3939e-02, 3.6574e-02,+ 5.0562e-02, 4.9973e-02, 3.3594e-02, 5.9822e-02, 2.0066e-01, 1.5290e-01, -4.6996e-01,+ 1.0431e-07, -5.8716e-01, -3.8846e-01, -4.6433e-01, -5.3078e-01, -3.0849e-01, -6.3539e-01,+ -4.8422e-01, -7.1236e-01, 9.6370e-01, 1.1176e-08, 7.9614e-01, 5.2212e-01, 6.2959e-01,+ 7.1341e-01, 4.1829e-01, 8.5400e-01, 4.7555e-01, 7.0847e-01, -4.7132e-01, -6.7055e-08,+ -2.5222e-01, -1.6637e-01, -1.9946e-01, -2.2732e-01, -1.3252e-01, -2.7212e-01, -1.1716e-01,+ -7.3543e-02, 7.1247e-02, 1.1176e-08, -2.1195e-02, -1.4046e-02, -1.6761e-02, -1.9191e-02,+ -1.1135e-02, -2.2974e-02, 1.0323e-02, -1.0876e-01, -6.5584e-02, -1.4901e-08, -6.5221e-03,+ -3.9840e-03, -5.1576e-03, -5.4441e-03, -3.4269e-03, -6.5171e-03, -4.3364e-02, 3.5198e-02,+ 4.7124e-02, -2.9802e-08, -3.2645e-03, -1.3218e-03, -2.5820e-03, -1.8056e-03, -1.7148e-03,+ -2.1611e-03, 4.1531e-02, -2.1872e-02, -4.9111e-02, 0.0000e+00, -2.5608e-03, 0.0000e+00,+ -2.0245e-03, 0.0000e+00, -1.3463e-03, 0.0000e+00, -4.6949e-02, 0.0000e+00});++ reference_tests::Tensor output_stft_9_5_2_transp_win_hann_period_center(+ Shape{9, 5, 2},+ ET,+ std::vector<VT>{6.4288e-01, 0.0000e+00, 9.2500e-02, 0.0000e+00, 7.3152e-02, 0.0000e+00, 4.8597e-02,+ 0.0000e+00, -4.7876e-01, 0.0000e+00, -5.2404e-01, -1.1921e-07, 2.5575e-01, 1.4629e-01,+ 2.0225e-01, 1.9989e-01, 1.3437e-01, 2.3929e-01, 8.0262e-01, 6.1159e-01, -1.8798e+00,+ 4.1723e-07, -2.3486e+00, -1.5538e+00, -1.8573e+00, -2.1231e+00, -1.2340e+00, -2.5415e+00,+ -1.9369e+00, -2.8494e+00, 3.8548e+00, 4.4703e-08, 3.1846e+00, 2.0885e+00, 2.5184e+00,+ 2.8536e+00, 1.6732e+00, 3.4160e+00, 1.9022e+00, 2.8339e+00, -1.8853e+00, -2.6822e-07,+ -1.0089e+00, -6.6547e-01, -7.9783e-01, -9.0929e-01, -5.3007e-01, -1.0885e+00, -4.6863e-01,+ -2.9417e-01, 2.8499e-01, 4.4703e-08, -8.4780e-02, -5.6183e-02, -6.7043e-02, -7.6764e-02,+ -4.4541e-02, -9.1897e-02, 4.1290e-02, -4.3506e-01, -2.6234e-01, -5.9605e-08, -2.6088e-02,+ -1.5936e-02, -2.0630e-02, -2.1776e-02, -1.3708e-02, -2.6068e-02, -1.7346e-01, 1.4079e-01,+ 1.8850e-01, -1.1921e-07, -1.3058e-02, -5.2870e-03, -1.0328e-02, -7.2225e-03, -6.8594e-03,+ -8.6446e-03, 1.6612e-01, -8.7487e-02, -1.9645e-01, 0.0000e+00, -1.0243e-02, 0.0000e+00,+ -8.0982e-03, 0.0000e+00, -5.3853e-03, 0.0000e+00, -1.8780e-01, 0.0000e+00});++ reference_tests::Tensor output_stft_9_5_2_transp_win_hann_center(+ Shape{9, 5, 2},+ ET,+ std::vector<VT>{6.9553e-01, 0.0000e+00, 1.6603e-01, 0.0000e+00, 1.5808e-01, 0.0000e+00, 1.3889e-01,+ 0.0000e+00, -4.2351e-01, 0.0000e+00, -3.9394e-01, -5.8741e-02, 4.4552e-01, 1.0763e-01,+ 4.0360e-01, 2.0588e-01, 3.3302e-01, 2.8950e-01, 1.0469e+00, 6.2184e-01, -1.8603e+00,+ 4.5327e-01, -2.4868e+00, -1.1705e+00, -2.0868e+00, -1.7925e+00, -1.5385e+00, -2.2871e+00,+ -2.1314e+00, -2.5705e+00, 3.6116e+00, 4.9244e-02, 2.8938e+00, 2.1352e+00, 2.2286e+00,+ 2.8211e+00, 1.4049e+00, 3.3065e+00, 1.5360e+00, 2.8408e+00, -1.9225e+00, -3.4335e-01,+ -8.9832e-01, -9.8693e-01, -6.0476e-01, -1.1902e+00, -2.6823e-01, -1.3088e+00, -2.8283e-01,+ -5.4008e-01, 3.4255e-01, 1.2559e-02, -3.2922e-02, -5.4718e-02, -1.7115e-02, -6.1602e-02,+ -9.1553e-05, -6.4114e-02, 1.1357e-01, -4.4302e-01, -2.3653e-01, -5.6663e-03, -3.8263e-03,+ -1.0372e-02, -1.3686e-03, -1.0818e-02, 1.1847e-03, -1.0495e-02, -1.6184e-01, 1.5109e-01,+ 2.0243e-01, 3.8466e-03, -4.6578e-04, -2.0989e-03, -7.1570e-04, -1.9433e-03, -9.1043e-04,+ -1.6500e-03, 1.8387e-01, -8.4278e-02, -1.8225e-01, 0.0000e+00, -1.4386e-04, 0.0000e+00,+ -9.4226e-04, 0.0000e+00, -1.6809e-03, 0.0000e+00, -1.8522e-01, 0.0000e+00});++ reference_tests::Tensor output_stft_9_5_2_transp_win_hann_center_norm(+ Shape{9, 5, 2},+ ET,+ std::vector<VT>{1.7388e-01, 0.0000e+00, 4.1509e-02, 0.0000e+00, 3.9521e-02, 0.0000e+00, 3.4723e-02,+ 0.0000e+00, -1.0588e-01, 0.0000e+00, -9.8485e-02, -1.4685e-02, 1.1138e-01, 2.6907e-02,+ 1.0090e-01, 5.1469e-02, 8.3255e-02, 7.2374e-02, 2.6173e-01, 1.5546e-01, -4.6508e-01,+ 1.1332e-01, -6.2169e-01, -2.9264e-01, -5.2170e-01, -4.4813e-01, -3.8463e-01, -5.7178e-01,+ -5.3284e-01, -6.4262e-01, 9.0291e-01, 1.2311e-02, 7.2346e-01, 5.3381e-01, 5.5715e-01,+ 7.0528e-01, 3.5124e-01, 8.2664e-01, 3.8400e-01, 7.1019e-01, -4.8062e-01, -8.5839e-02,+ -2.2458e-01, -2.4673e-01, -1.5119e-01, -2.9754e-01, -6.7057e-02, -3.2721e-01, -7.0707e-02,+ -1.3502e-01, 8.5637e-02, 3.1397e-03, -8.2305e-03, -1.3679e-02, -4.2788e-03, -1.5400e-02,+ -2.2888e-05, -1.6028e-02, 2.8393e-02, -1.1075e-01, -5.9133e-02, -1.4166e-03, -9.5657e-04,+ -2.5929e-03, -3.4216e-04, -2.7046e-03, 2.9618e-04, -2.6238e-03, -4.0460e-02, 3.7772e-02,+ 5.0607e-02, 9.6166e-04, -1.1645e-04, -5.2471e-04, -1.7893e-04, -4.8584e-04, -2.2761e-04,+ -4.1250e-04, 4.5969e-02, -2.1069e-02, -4.5562e-02, 0.0000e+00, -3.5964e-05, 0.0000e+00,+ -2.3557e-04, 0.0000e+00, -4.2021e-04, 0.0000e+00, -4.6305e-02, 0.0000e+00});++ reference_tests::Tensor auto_length(Shape{0}, IT, std::vector<INT_T>{});+ reference_tests::Tensor length_16(Shape{}, IT, std::vector<INT_T>{16});+ reference_tests::Tensor length_39(Shape{}, IT, std::vector<INT_T>{39});+ reference_tests::Tensor length_48(Shape{}, IT, std::vector<INT_T>{48});+ reference_tests::Tensor length_55(Shape{}, IT, std::vector<INT_T>{55});+ reference_tests::Tensor length_60(Shape{}, IT, std::vector<INT_T>{60});++ std::vector<ISTFTParams> params;+ params.emplace_back(output_stft_9_1_2_transp_win_one,+ ones_window_16,+ frame_size_16,+ frame_step_16,+ auto_length,+ false,+ false,+ signal_16,+ "basic_1D_transp_ones_win_step_16");+ params.emplace_back(output_stft_9_1_2_transp_win_one,+ ones_window_16,+ frame_size_16,+ frame_step_4,+ auto_length,+ false,+ false,+ signal_16,+ "basic_1D_transp_ones_win_step_4");+ params.emplace_back(output_stft_9_1_2_transp_win_two,+ two_window_16,+ frame_size_16,+ frame_step_16,+ auto_length,+ false,+ false,+ signal_16,+ "basic_1D_transp_two_win_step_16");+ params.emplace_back(output_stft_9_1_2_transp_win_two,+ two_window_16,+ frame_size_16,+ frame_step_4,+ auto_length,+ false,+ false,+ signal_16,+ "basic_1D_transp_two_win_step_4");+ params.emplace_back(output_stft_9_3_2_transp_win_two,+ two_window_16,+ frame_size_16,+ frame_step_16,+ auto_length,+ false,+ false,+ signal_48,+ "basic_1D_transp_two_win_step_16");++ params.emplace_back(output_stft_9_3_2_transp_win_two,+ two_window_16,+ frame_size_16,+ frame_step_16,+ length_48,+ false,+ false,+ signal_48,+ "basic_1D_transp_two_win_step_16_length_48");++ params.emplace_back(output_stft_9_3_2_transp_win_two,+ two_window_16,+ frame_size_16,+ frame_step_16,+ length_55,+ false,+ false,+ signal_48_pad_0_to_55,+ "basic_1D_transp_two_win_step_16_length_55");++ params.emplace_back(output_stft_9_3_2_transp_win_two,+ two_window_16,+ frame_size_16,+ frame_step_16,+ length_39,+ false,+ false,+ signal_39,+ "basic_1D_transp_two_win_step_16_length_39");++ params.emplace_back(output_stft_2_9_3_2_transp_win_two,+ two_window_16,+ frame_size_16,+ frame_step_16,+ auto_length,+ false,+ false,+ signal_2_48,+ "basic_2D_transp_two_win_step_16");+ params.emplace_back(output_stft_9_4_2_transp_win_two_center,+ two_window_16,+ frame_size_16,+ frame_step_16,+ auto_length,+ true,+ false,+ signal_48,+ "basic_1D_transp_two_win_step_16_center");+ params.emplace_back(output_stft_9_4_2_transp_win_two_center_norm,+ two_window_16,+ frame_size_16,+ frame_step_16,+ auto_length,+ true,+ true,+ signal_48,+ "basic_1D_transp_two_win_step_16_center_norm");+ params.emplace_back(output_stft_2_9_4_2_transp_win_two_center,+ two_window_16,+ frame_size_16,+ frame_step_16,+ auto_length,+ true,+ false,+ signal_2_48,+ "basic_2D_transp_two_win_step_16_center");+ params.emplace_back(output_stft_2_9_4_2_transp_win_two_center,+ two_window_16,+ frame_size_16,+ frame_step_16,+ length_48,+ true,+ false,+ signal_2_48,+ "basic_2D_transp_two_win_step_16_center_length_48");+ params.emplace_back(output_stft_9_4_2_transp_win_two_center_norm,+ two_window_16,+ frame_size_16,+ frame_step_16,+ length_39,+ true,+ true,+ signal_39,+ "basic_1D_transp_two_win_step_16_center_norm_length_39");++ params.emplace_back(output_stft_9_4_2_transp_win_two_center_norm,+ two_window_16,+ frame_size_16,+ frame_step_16,+ length_55,+ true,+ true,+ signal_55,+ "basic_1D_transp_two_win_step_16_center_norm_length_55");++ params.emplace_back(output_stft_9_4_2_transp_win_two_center_norm,+ two_window_16,+ frame_size_16,+ frame_step_16,+ length_60,+ true,+ true,+ signal_60,+ "basic_1D_transp_two_win_step_16_center_norm_length_60");++ params.emplace_back(output_stft_9_5_2_transp_win_hann_center_norm,+ hann_window_16,+ frame_size_16,+ frame_step_12,+ auto_length,+ true,+ true,+ signal_48,+ "basic_1D_transp_hann_win_step_16");++ params.emplace_back(output_stft_9_5_2_transp_win_hann_center,+ hann_window_16,+ frame_size_16,+ frame_step_12,+ auto_length,+ true,+ false,+ signal_48,+ "basic_1D_transp_hann_win_step_16");++ params.emplace_back(output_stft_9_5_2_transp_win_hann_period_center_norm,+ hann_window_period_16,+ frame_size_16,+ frame_step_12,+ auto_length,+ true,+ true,+ signal_48,+ "basic_1D_transp_hann_period_win_step_16");++ params.emplace_back(output_stft_9_5_2_transp_win_hann_period_center,+ hann_window_period_16,+ frame_size_16,+ frame_step_12,+ auto_length,+ true,+ false,+ signal_48,+ "basic_1D_transp_hann_period_win_step_16");++ return params;+}++std::vector<ISTFTParams> generateISTFTParams() {+ std::vector<std::vector<ISTFTParams>> combo_params{generateISTFTParams<ov::element::f32>()};+ std::vector<ISTFTParams> test_params;+ for (auto& params : combo_params)+ std::move(params.begin(), params.end(), std::back_inserter(test_params));+ return test_params;+}+} // namespace++TEST_P(ReferenceISTFT, CompareWithRefs) {+ Exec();+}++INSTANTIATE_TEST_SUITE_P(smoke,+ ReferenceISTFT,+ ::testing::ValuesIn(generateISTFTParams()),+ ReferenceISTFT::getTestCaseName);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.cppindex 6c810ec4ac2..cb29df89f5e 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@@ -1939,6 +1939,18 @@ std::shared_ptr<ov::Model> generate(const std::shared_ptr<ov::op::v15::STFT>& noreturn std::make_shared<ov::Model>(results, ov::ParameterVector{data, window}, "STFTGraph");}+std::shared_ptr<ov::Model> generate(const std::shared_ptr<ov::op::v16::ISTFT>& node) {+ const auto data = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::PartialShape{9, 2, 2});+ const auto window = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::PartialShape{16});+ const auto frame_size = ov::op::v0::Constant::create<int32_t>(ov::element::i32, {}, {16});+ const auto step_size = ov::op::v0::Constant::create<int32_t>(ov::element::i32, {}, {4});+ constexpr bool center = true;+ constexpr bool normalized = true;+ const auto stft = std::make_shared<ov::op::v16::ISTFT>(data, window, frame_size, step_size, center, normalized);+ ov::ResultVector results{std::make_shared<ov::op::v0::Result>(stft)};+ return std::make_shared<ov::Model>(results, ov::ParameterVector{data, window}, "ISTFTGraph");+}+std::shared_ptr<ov::Model> generate(const std::shared_ptr<ov::op::v15::StringTensorUnpack> &node) {const auto data = std::make_shared<ov::op::v0::Parameter>(ov::element::string, ov::PartialShape{2});const auto StringTensorUnpackNode = std::make_shared<ov::op::v15::StringTensorUnpack>(data);