[Core] Fix GridSample assertion (#11924)
* Fix GridSample assertion * Avoid ONNX opset 17 backend tests
This commit is contained in:
parent
d25b8466f6
commit
c8ced8728e
@ -23,7 +23,7 @@ flake8_pep3101
|
||||
flake8_quotes
|
||||
import-order
|
||||
mypy
|
||||
onnx
|
||||
onnx<1.12.0
|
||||
Pep8-naming
|
||||
pydocstyle
|
||||
pytest-xdist
|
||||
@ -33,4 +33,4 @@ retrying
|
||||
tox
|
||||
types-pkg_resources
|
||||
wheel>=0.36.2
|
||||
protobuf>=3.18,<4.0.0
|
||||
protobuf>=3.18,<4.0.0
|
||||
|
@ -226,7 +226,7 @@ void grid_sample(DATA_ET* output,
|
||||
const ov::op::v9::GridSample::InterpolationMode interpolation_mode,
|
||||
const ov::op::v9::GridSample::PaddingMode padding_mode) {
|
||||
assert(data_shape.size() == 4 && grid_shape.size() == 4);
|
||||
assert(data_shape[0] == grid_shape[0] and grid_shape[3] == 2);
|
||||
assert(data_shape[0] == grid_shape[0] && grid_shape[3] == 2);
|
||||
|
||||
const auto N = data_shape[0];
|
||||
const auto C = data_shape[1];
|
||||
@ -271,16 +271,13 @@ void grid_sample(DATA_ET* output,
|
||||
|
||||
switch (interpolation_mode) {
|
||||
case ov::op::v9::GridSample::InterpolationMode::BILINEAR:
|
||||
out =
|
||||
bilinear<DATA_ET, GRID_ET>(data, data_shape, n, c, y_n, x_n, get_padded_fn, denormalize_fn);
|
||||
out = bilinear(data, data_shape, n, c, y_n, x_n, get_padded_fn, denormalize_fn);
|
||||
break;
|
||||
case ov::op::v9::GridSample::InterpolationMode::NEAREST:
|
||||
out =
|
||||
nearest<DATA_ET, GRID_ET>(data, data_shape, n, c, y_n, x_n, get_padded_fn, denormalize_fn);
|
||||
out = nearest(data, data_shape, n, c, y_n, x_n, get_padded_fn, denormalize_fn);
|
||||
break;
|
||||
case ov::op::v9::GridSample::InterpolationMode::BICUBIC:
|
||||
out =
|
||||
bicubic<DATA_ET, GRID_ET>(data, data_shape, n, c, y_n, x_n, get_padded_fn, denormalize_fn);
|
||||
out = bicubic(data, data_shape, n, c, y_n, x_n, get_padded_fn, denormalize_fn);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user