Skip to content

Commit 0c9c805

Browse files
committed
PR fixes
1 parent d840edc commit 0c9c805

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

docs/commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Depending on the specified reply format:
7979
1. The tensor's shape as an Array consisting of an item per dimension
8080
* **BLOB**: the tensor's binary data as a String. If used together with the **META** option, the binary data string will put after the metadata in the array reply.
8181
* **VALUES**: Array containing the numerical representation of the tensor's data. If used together with the **META** option, the binary data string will put after the metadata in the array reply.
82-
* Default: META+BLOB are returned by default, in case that non of the arguments above is specified.
82+
* Default: **META** and **BLOB** are returned by default, in case that non of the arguments above is specified.
8383

8484

8585
**Examples**

src/tensor.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,8 +851,9 @@ uint ParseTensorGetArgs(RedisModuleCtx *ctx, RedisModuleString **argv, int argc)
851851
RedisModule_WrongArity(ctx);
852852
return fmt;
853853
}
854-
if (argc == 2)
855-
fmt = TENSOR_BLOB | TENSOR_META;
854+
if (argc == 2) {
855+
return TENSOR_BLOB | TENSOR_META;
856+
}
856857
for (int i = 2; i < argc; i++) {
857858
const char *fmtstr = RedisModule_StringPtrLen(argv[i], NULL);
858859
if (!strcasecmp(fmtstr, "BLOB")) {

tests/flow/tests_common.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,10 @@ def test_common_tensorget(env):
205205
env.assertEqual(datatype.encode('utf-8'), tensor_dtype)
206206
env.assertEqual([2], tensor_dim)
207207

208-
# Confirm that default reply format is META BLOB
208+
# Confirm that default reply format is META BLOB
209+
for datatype in tested_datatypes:
210+
_, tensor_dtype, _, tensor_dim, _, tensor_blob = con.execute_command('AI.TENSORGET', 'tensor_{0}'.format(datatype),
211+
'META', 'BLOB')
209212
_, tensor_dtype_default, _, tensor_dim_default, _, tensor_blob_default = con.execute_command('AI.TENSORGET',
210213
'tensor_{0}'.format(datatype))
211214
env.assertEqual(tensor_dtype, tensor_dtype_default)

0 commit comments

Comments
 (0)