forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathincorrect_cut_model.cpp
32 lines (25 loc) · 1.05 KB
/
incorrect_cut_model.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (C) 2018-2025 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <gtest/gtest.h>
#include <openvino/frontend/exception.hpp>
#include <openvino/frontend/manager.hpp>
#include "paddle_utils.hpp"
#include "utils.hpp"
using namespace ov::frontend;
TEST(FrontEndIncorrectCutModelTest, test_incorrect_cut) {
FrontEndManager fem;
FrontEnd::Ptr frontEnd;
InputModel::Ptr inputModel;
OV_ASSERT_NO_THROW(frontEnd = fem.load_by_framework(PADDLE_FE));
ASSERT_NE(frontEnd, nullptr);
auto model_filename = FrontEndTestUtils::make_model_path(std::string(TEST_PADDLE_MODELS_DIRNAME) +
std::string("2in_2out/2in_2out.pdmodel"));
OV_ASSERT_NO_THROW(inputModel = frontEnd->load(model_filename));
ASSERT_NE(inputModel, nullptr);
// remove second input
inputModel->override_all_inputs({inputModel->get_inputs()[0]});
std::shared_ptr<ov::Model> model;
ASSERT_THROW(model = frontEnd->convert(inputModel), GeneralFailure);
ASSERT_EQ(model, nullptr);
}