Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/frontends/onnx/frontend/src/op/resize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ ov::OutputVector resize(const ov::frontend::onnx::Node& node) {
}
auto axes_attr = node.get_attribute_value<std::vector<int64_t>>("axes", {});
if (axes_attr.empty()) {
if (node.has_attribute("axes")) {
return {data};
}
return {std::make_shared<v11::Interpolate>(data, scale_or_sizes, attrs)};
}

Expand Down
29 changes: 29 additions & 0 deletions src/frontends/onnx/tests/tests_python/test_ops_resize.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

import numpy as np
import onnx
from onnx import helper

from tests.tests_python.utils import run_model


def test_resize_with_empty_axes_is_noop():
input_data = np.arange(4, dtype=np.float32).reshape(1, 1, 2, 2)
scales = np.array([], dtype=np.float32)

node = helper.make_node("Resize", ["x", "", "scales"], ["y"], axes=[])
graph = helper.make_graph(
[node],
"resize_empty_axes",
[
helper.make_tensor_value_info("x", onnx.TensorProto.FLOAT, input_data.shape),
helper.make_tensor_value_info("scales", onnx.TensorProto.FLOAT, scales.shape),
],
[helper.make_tensor_value_info("y", onnx.TensorProto.FLOAT, input_data.shape)],
)
model = helper.make_model(graph, opset_imports=[helper.make_opsetid("", 18)])

result = run_model(model, [input_data, scales])[0]
np.testing.assert_array_equal(result, input_data)
Loading