Skip to content

Commit

Permalink
Change method to initialize input data
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsnam-intel committed Oct 30, 2024
1 parent d1e93b8 commit d3b882f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/plugins/intel_gpu/src/plugin/sync_infer_request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,8 @@ void SyncInferRequest::allocate_input(const ov::Output<const ov::Node>& port, si
if (element_type == ov::element::string) {
// In case the element type is string and input data is an empty string,
// it produces the segmentation fault unless the each element of tensor.data is initialized.
std::string* data = m_user_inputs.at(input_idx).ptr->data<std::string>();
for (size_t i = 0; i < m_user_inputs.at(input_idx).ptr->get_size(); ++i) {
data->get_allocator().construct(data + i, std::string());
}
auto data = m_user_inputs.at(input_idx).ptr->data<std::string>();
std::uninitialized_fill_n(data, m_user_inputs.at(input_idx).ptr->get_size(), std::string());
}
ov::ISyncInferRequest::set_tensor(port, m_user_inputs.at(input_idx).ptr);
}
Expand Down

0 comments on commit d3b882f

Please sign in to comment.