Skip to content

Commit

Permalink
Fixed coverity issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinwadhwa921 committed Oct 9, 2024
1 parent 783b147 commit 9101750
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions onnxruntime/core/providers/openvino/backends/basic_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ void BasicBackend::StartAsyncInference(Ort::KernelContext& context, OVInferReque
input_tensor_shape[tensor_iter] = *i;
tensor_iter += 1;
}
auto input = graph_input_info.at(input_idx);
const auto& input = graph_input_info.at(input_idx);
OVTensorPtr tensor_ptr;
// avoid input copies on the CPU device
if (global_context_.device_type.find("CPU") != std::string::npos) {
Expand Down Expand Up @@ -387,7 +387,7 @@ void BasicBackend::StartAsyncInference(Ort::KernelContext& context, OVInferReque
ort_ov_tensor_map[ort_tensor_key] = ov_tensor_data;

try {
infer_request->SetTensor(input_name, ov_tensor_data.tensor_ptr);
infer_request->SetTensor(std::move(input_name), ov_tensor_data.tensor_ptr);
} catch (const char* msg) {
ORT_THROW(msg);
}
Expand Down Expand Up @@ -425,14 +425,14 @@ void BasicBackend::StartAsyncInference(Ort::KernelContext& context, OVInferReque
if ((it == ort_ov_tensor_map.end()) ||
(it != ort_ov_tensor_map.end() && (it->second.ort_ptr != tensor.GetTensorRawData()))) {
ov_tensor_data_t ov_tensor_data;
auto output = graph_output_info.at(output_idx);
const auto& output = graph_output_info.at(output_idx);
ov_tensor_data.ort_ptr = tensor.GetTensorRawData();
ov_tensor_data.tensor_ptr = std::make_shared<ov::Tensor>(output.get_element_type(), output.get_shape(),
const_cast<void*>(tensor.GetTensorRawData()));
ort_ov_tensor_map[ort_tensor_key] = ov_tensor_data;

try {
infer_request->SetTensor(output_name, ov_tensor_data.tensor_ptr);
infer_request->SetTensor(std::move(output_name), ov_tensor_data.tensor_ptr);
} catch (const char* msg) {
ORT_THROW(msg);
}
Expand Down

0 comments on commit 9101750

Please sign in to comment.