Check output shape in OVInferRequestDynamicTests (#20398)

Co-authored-by: Ilya Churaev <ilya.churaev@intel.com>
This commit is contained in:
Sergey E. Losev 2023-10-16 17:46:49 +04:00 committed by GitHub
parent 475ddb9283
commit bee7559faa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -76,6 +76,14 @@ bool OVInferRequestDynamicTests::checkOutput(const ov::runtime::Tensor& in, cons
tensor.data<float>()[i] = in.data<float>()[i];
}
req.infer();
const auto reqShape = req.get_output_tensor(0).get_shape();
const auto actualShape = actual.get_shape();
if (reqShape.size() != actualShape.size()) {
return false;
}
if (!std::equal(reqShape.cbegin(), reqShape.cend(), actualShape.cbegin())) {
return false;
}
for (int i = 0; i < actual.get_size(); i++) {
if (fabs(req.get_output_tensor(0).data<float>()[i] - actual.data<float>()[i]) > std::numeric_limits<float>::epsilon())
return false;