[GPU] Delete previous inputs by numbered new name for batching (#12045)
This commit is contained in:
@@ -456,8 +456,18 @@ void InferRequest::SetBlobs(const std::string& name, const std::vector<Blob::Ptr
|
||||
"Current: " << dataBinSize << " Required: " << netReqBinSize;
|
||||
}
|
||||
|
||||
if (_inputs.find(name) != _inputs.end()) {
|
||||
_inputs.erase(name);
|
||||
if (is_surface) {
|
||||
for (size_t i = 0; i < blobs.size(); ++i) {
|
||||
std::string new_name = name + "_" + std::to_string(i);
|
||||
|
||||
if (_inputs.find(new_name) != _inputs.end()) {
|
||||
_inputs.erase(new_name);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (_inputs.find(name) != _inputs.end()) {
|
||||
_inputs.erase(name);
|
||||
}
|
||||
}
|
||||
|
||||
if (is_remote) {
|
||||
|
||||
@@ -1041,10 +1041,12 @@ TEST_P(OVRemoteTensorBatched_Test, NV12toBGR_image) {
|
||||
tensor_remote_uv.emplace_back(cldnn_context.create_tensor(param_input_uv->get_element_type(), fake_image_data_uv[i].get_shape(), img_uv[i]));
|
||||
}
|
||||
|
||||
inf_req_remote.set_tensors(*param_input_y->output(0).get_tensor().get_names().begin(), tensor_remote_y);
|
||||
inf_req_remote.set_tensors(*param_input_uv->output(0).get_tensor().get_names().begin(), tensor_remote_uv);
|
||||
for (size_t i = 0; i < 5; ++i) { // to test repeating set_tensors/infer functionality
|
||||
inf_req_remote.set_tensors(*param_input_y->output(0).get_tensor().get_names().begin(), tensor_remote_y);
|
||||
inf_req_remote.set_tensors(*param_input_uv->output(0).get_tensor().get_names().begin(), tensor_remote_uv);
|
||||
|
||||
inf_req_remote.infer();
|
||||
inf_req_remote.infer();
|
||||
}
|
||||
|
||||
auto output_tensor_shared = inf_req_remote.get_tensor(function->get_results().at(0));
|
||||
ASSERT_NO_THROW(output_tensor_shared.data());
|
||||
|
||||
Reference in New Issue
Block a user