Skip to content

Conversation

@praasz
Copy link
Contributor

@praasz praasz commented Oct 31, 2025

Details:

  • The ONNX specification for DFT-17, DFT-20 operator defines dft_length as scalar input which is not compatible with OV FFT operators (Must be 1-D). In case of scalar input unsqueeze this input to 1-D.

Tickets:

  • N/A

Signed-off-by: Raasz, Pawel <pawel.raasz@intel.com>
@praasz praasz requested a review from a team as a code owner October 31, 2025 12:14
@github-actions github-actions bot added the category: ONNX FE OpenVINO ONNX FrontEnd label Oct 31, 2025

bool dft_length_provided = !ov::op::util::is_null(length);
const bool dft_length_provided = !ov::op::util::is_null(length);
const auto unsqueeze_axis = v0::Constant::create(ov::element::i64, {}, {-1});
Copy link
Collaborator

@rkazants rkazants Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const auto unsqueeze_axis = v0::Constant::create(ov::element::i64, {}, {-1});
const auto unsqueeze_axis = v0::Constant::create(ov::element::i32, {}, {0});

i32 is quite enough. Also, let use define axis, not -1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Id like to same const in two cases and originally this const was i64.
But if this is ok to use i32 in both places I can change it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, i32 works and we waste less memory.

const auto unsqueeze_axis = v0::Constant::create(ov::element::i64, {}, {-1});
const auto& signal_size = [&] {
if (dft_length_provided) {
if (const auto& rank = length.get_partial_shape().rank(); rank.get_max_length() == 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here you also need to check rank().is_static()

I propose to use Reshape operation with shape=[1] and apply this operation always without check. Or at least, apply Reshape when rank is dynamic.

Copy link
Contributor Author

@praasz praasz Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to check static, max length is 0 for scalar.

But in case if input is 2-D, reshape will change it to 1-D, but it should be still an error condition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: ONNX FE OpenVINO ONNX FrontEnd

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants