-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PyAPI] Fix string truncation when special \u0000 is inside string #28373
base: master
Are you sure you want to change the base?
[PyAPI] Fix string truncation when special \u0000 is inside string #28373
Conversation
align py::array conversion with numpy logic Signed-off-by: Raasz, Pawel <[email protected]>
Signed-off-by: Raasz, Pawel <[email protected]>
Signed-off-by: Raasz, Pawel <[email protected]>
Signed-off-by: Raasz, Pawel <[email protected]>
@@ -118,15 +118,29 @@ const TensorIndexMap cast_to_tensor_index_map(const py::dict& inputs) { | |||
|
|||
namespace string_helpers { | |||
|
|||
namespace { | |||
auto find_last_not_null(const std::string& str) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please specify a return type here for readability?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was done intentionally to auto deduce return type. As local scope helper is easier to modify it. The IDE's hint or compiler will show detailed type if there will be wrong use.
Signed-off-by: Raasz, Pawel <[email protected]>
Signed-off-by: Raasz, Pawel <[email protected]>
Signed-off-by: Raasz, Pawel <[email protected]>
Details:
py::array
ov::Tensor
numpy
format when there are trailing null characters. The strides will be not same for OV representation. This is not real (very uncommon) case of use string with many trailing null characters.Related PRs:
Tickets: