Unbreak ShapeOf conformance test with dynamic shapes (#13326)
This commit is contained in:
parent
5519fff5c2
commit
daa8aaa894
@ -93,6 +93,10 @@ void ReadIRTest::query_model() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint64_t clip(uint64_t n, uint64_t lower, uint64_t upper) {
|
||||||
|
return std::max(lower, std::min(n, upper));
|
||||||
|
}
|
||||||
|
|
||||||
void ReadIRTest::SetUp() {
|
void ReadIRTest::SetUp() {
|
||||||
// in case of crash jump will be made and work will be continued
|
// in case of crash jump will be made and work will be continued
|
||||||
auto crashHandler = std::unique_ptr<CommonTestUtils::CrashHandler>(new CommonTestUtils::CrashHandler());
|
auto crashHandler = std::unique_ptr<CommonTestUtils::CrashHandler>(new CommonTestUtils::CrashHandler());
|
||||||
@ -208,13 +212,14 @@ void ReadIRTest::SetUp() {
|
|||||||
staticShapes[1] = midShape;
|
staticShapes[1] = midShape;
|
||||||
|
|
||||||
// Shape validation to avoid large values
|
// Shape validation to avoid large values
|
||||||
for (auto& shape : staticShapes) {
|
uint64_t dimMin = 1;
|
||||||
for (auto& dim : shape) {
|
uint64_t dimMax = std::numeric_limits<char>::max();
|
||||||
if (dim == 0) {
|
for (int i = 0; i < staticShapes[0].size(); ++i) {
|
||||||
dim = 1;
|
auto& dim0 = staticShapes[0][i];
|
||||||
} else if (dim > std::numeric_limits<char>::max()) {
|
auto& dim2 = staticShapes[2][i];
|
||||||
dim = std::numeric_limits<char>::max();
|
if (dim0 != dim2) {
|
||||||
}
|
dim0 = clip(dim0, dimMin, dimMax);
|
||||||
|
dim2 = clip(dim2, dimMin, dimMax);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
inputShapes.push_back(InputShape{param->get_partial_shape(), staticShapes});
|
inputShapes.push_back(InputShape{param->get_partial_shape(), staticShapes});
|
||||||
|
Loading…
Reference in New Issue
Block a user