Skip to content

Conversation

alonre24
Copy link
Collaborator

@alonre24 alonre24 commented Sep 9, 2021

Added documentation + examples for the new tensor types recently added - BOOL and STRING.
Also, added a verification that bool tensor blob contains only valid values (that is 0 or 1), even though every element's size is one byte.

This PR waits for merging string tensor PR #832, that will be merged soon (after CI is fixed)

@alonre24 alonre24 requested a review from DvirDukhan September 9, 2021 13:49
@codecov
Copy link

codecov bot commented Sep 9, 2021

Codecov Report

Merging #842 (a3ca958) into master (de0f302) will increase coverage by 1.27%.
The diff coverage is 91.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #842      +/-   ##
==========================================
+ Coverage   79.97%   81.25%   +1.27%     
==========================================
  Files          53       55       +2     
  Lines        8009     8145     +136     
==========================================
+ Hits         6405     6618     +213     
+ Misses       1604     1527      -77     
Impacted Files Coverage Δ
src/serialization/AOF/rai_aof_rewrite.c 0.00% <0.00%> (ø)
.../serialization/RDB/decoder/previous/v2/decode_v2.c 46.56% <0.00%> (+9.81%) ⬆️
src/execution/parsing/deprecated.c 81.18% <66.66%> (+1.48%) ⬆️
...c/serialization/RDB/decoder/current/v4/decode_v4.c 71.42% <71.42%> (ø)
.../serialization/RDB/decoder/previous/v0/decode_v0.c 63.33% <72.72%> (+1.69%) ⬆️
tests/module/LLAPI.c 75.91% <79.06%> (+1.44%) ⬆️
src/serialization/RDB/encoder/v4/encode_v4.c 85.96% <81.81%> (ø)
src/backends/tensorflow.c 72.16% <91.00%> (+3.12%) ⬆️
src/backends/onnxruntime.c 78.80% <91.86%> (+1.42%) ⬆️
src/redis_ai_objects/tensor.c 91.93% <94.71%> (+5.24%) ⬆️
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d2565ac...a3ca958. Read the comment docs.

@alonre24 alonre24 marked this pull request as ready for review September 12, 2021 06:23
docs/commands.md Outdated
```

###String Tensors
String tensors are tensors in which every element is a single C-string in utf-8 format. A string element can be at any length, and it cannot contain a null-character (unless it is the last character of the string).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
String tensors are tensors in which every element is a single C-string in utf-8 format. A string element can be at any length, and it cannot contain a null-character (unless it is the last character of the string).
String tensors are tensors in which every element is a single C-string in utf-8 format. A string element can be at any length, and it cannot contain a null-character (unless it is a null-terminated string).

docs/commands.md Outdated

###String Tensors
String tensors are tensors in which every element is a single C-string in utf-8 format. A string element can be at any length, and it cannot contain a null-character (unless it is the last character of the string).
In blob format, string elements are encoded and concatenated, so that the size of string tensor blob is not determined given the tensor's shapes (unlike in the rest of tensor types)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

encoded?
please explain what is the dlimiter.
if the size of a string tensor is not determined given the tensor's shapes, please explain how it is determined

Copy link

@DvirDukhan DvirDukhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alonre24 I made a quick browse over the TENSORGET part. please modify this one also

@alonre24 alonre24 merged commit 5e2de0a into master Sep 13, 2021
@alonre24 alonre24 deleted the documention_string_and_bool_tensor_types branch September 13, 2021 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants