[Core] Fix GridSample assertion (#11924)

* Fix GridSample assertion

* Avoid ONNX opset 17 backend tests
This commit is contained in:
Tomasz Jankowski 2022-06-21 23:28:21 +02:00 committed by GitHub
parent d25b8466f6
commit c8ced8728e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 9 deletions

View File

@ -23,7 +23,7 @@ flake8_pep3101
flake8_quotes
import-order
mypy
onnx
onnx<1.12.0
Pep8-naming
pydocstyle
pytest-xdist

View File

@ -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;
}
}