-
Notifications
You must be signed in to change notification settings - Fork 13
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
String tensor support #90
Conversation
when the data is given by VALUE (and not with BLOB)
for setting and getting string tensors by VALUE
from numpy string array as blob
to test tensorset with numpy string array
d7d8cb7
to
fd3627b
Compare
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.
Looks good, few comments
Added a comment. Deleted numpy_string2blob and replaced with a single line using join. Deleted utils.recursive_bytetransform_str and sets 'target' to a decode function
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.
Good job :)
@@ -38,7 +43,9 @@ def blob2numpy( | |||
"""Convert `BLOB` result from RedisAI to `np.ndarray`.""" | |||
mm = {"FLOAT": "float32", "DOUBLE": "float64"} | |||
dtype = mm.get(dtype, dtype.lower()) | |||
if mutable: | |||
if dtype == 'string': | |||
a = np.array(value.decode().split('\0')[:-1], dtype='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.
You take [:-1]
because the last item is the empty string after the last \0
in the blob right? Consider documenting it
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
For now, added only support for STRING tensors set with VALUE.