Skip to content

Commit

Permalink
API 2.0 infer request io blob test case (openvinotoolkit#20336)
Browse files Browse the repository at this point in the history
* add failToSetUninitializedInputBlob, failToSetUninitializedOutputBlob and canInferWithGetOut

* FailedAsyncInferWithNegativeTimeForWait

* Revert "FailedAsyncInferWithNegativeTimeForWait"

This reverts commit 3b67801.

* Update src/tests/functional/plugin/shared/src/behavior/ov_infer_request/io_tensor.cpp

Co-authored-by: River Li <river.li@intel.com>

* Update src/tests/functional/plugin/shared/src/behavior/ov_infer_request/io_tensor.cpp

Co-authored-by: River Li <river.li@intel.com>

---------

Co-authored-by: River Li <river.li@intel.com>
  • Loading branch information
panhaiqi and riverlijunjie authored Dec 6, 2023
1 parent 1f01036 commit ddc395b
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ TEST_P(OVInferRequestIOTensorTest, failToSetNullptrForOutput) {
ASSERT_THROW(req.set_tensor(output, {}), ov::Exception);
}

TEST_P(OVInferRequestIOTensorTest, failToSetUninitializedInputTensor) {
ov::Tensor tensor;
OV_ASSERT_NO_THROW(req = execNet.create_infer_request());
ASSERT_THROW(req.set_tensor(input, tensor), ov::Exception);
}

TEST_P(OVInferRequestIOTensorTest, failToSetUninitializedOutputTensor) {
ov::Tensor tensor;
OV_ASSERT_NO_THROW(req = execNet.create_infer_request());
ASSERT_THROW(req.set_tensor(output, tensor), ov::Exception);
}

TEST_P(OVInferRequestIOTensorTest, canSetAndGetInput) {
auto tensor = utils::create_and_fill_tensor(input.get_element_type(), input.get_shape());
OV_ASSERT_NO_THROW(req.set_tensor(input, tensor));
Expand Down Expand Up @@ -175,6 +187,15 @@ TEST_P(OVInferRequestIOTensorTest, canInferAfterIOBlobReallocation) {
OV_ASSERT_NO_THROW(req.get_tensor(output));
}

TEST_P(OVInferRequestIOTensorTest, canInferWithGetOut) {
ov::Tensor output_tensor;
OV_ASSERT_NO_THROW(output_tensor = req.get_tensor(output));
OV_ASSERT_NO_THROW(req.infer());
OV_ASSERT_NO_THROW(req.start_async());
OV_ASSERT_NO_THROW(req.wait());
OV_ASSERT_NO_THROW(req.get_tensor(output));
}

TEST_P(OVInferRequestIOTensorTest, InferStaticNetworkSetChangedInputTensorThrow) {
const ov::Shape shape1 = {1, 2, 32, 32};
const ov::Shape shape2 = {1, 2, 40, 40};
Expand Down

0 comments on commit ddc395b

Please sign in to comment.