Skip to content

Commit 03f2fb2

Browse files
committed
[add] fixed merge conflicts
1 parent c5e5972 commit 03f2fb2

File tree

1 file changed

+5
-37
lines changed

1 file changed

+5
-37
lines changed

src/redisai.c

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ int RAI_GetTensorFromKeyspace(RedisModuleCtx *ctx, RedisModuleString *keyName,
178178

179179
/* Return REDISMODULE_ERR if there was an error getting the Tensor.
180180
* Return REDISMODULE_OK if the tensor value is present at the localContextDict. */
181-
int RAI_GetTensorFromLocalContext(RedisModuleCtx *ctx,
181+
int RAI_getTensorFromLocalContext(RedisModuleCtx *ctx,
182182
AI_dict *localContextDict,
183183
const char *localContextKey,
184184
RAI_Tensor **tensor) {
@@ -825,22 +825,6 @@ int RAI_parseTensorGetArgs(RedisModuleCtx *ctx, RedisModuleString **argv, int ar
825825
}
826826
RedisModule_ReplyWithDouble(ctx, val);
827827
}
828-
argpos++;
829-
break;
830-
} else {
831-
long long dimension = 1;
832-
const int retval = RedisModule_StringToLongLong(argv[argpos],&dimension);
833-
if (retval != REDISMODULE_OK || dimension <= 0) {
834-
RedisModule_Free(dims);
835-
RedisModule_CloseKey(key);
836-
return RedisModule_ReplyWithError(ctx,
837-
"ERR invalid or negative value found in tensor shape");
838-
}
839-
840-
ndims++;
841-
dims=RedisModule_Realloc(dims,ndims*sizeof(long long));
842-
dims[ndims-1]=dimension;
843-
len *= dimension;
844828
}
845829
else {
846830
long long val;
@@ -919,13 +903,6 @@ int RedisAI_ModelSet_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv,
919903
if (strlen(devicestr) > 10) {
920904
return RedisModule_ReplyWithError(ctx, "ERR Invalid DEVICE");
921905
}
922-
else if (datafmt == REDISAI_DATA_VALUES) {
923-
long long ndims = RAI_TensorNumDims(t);
924-
long long len = 1;
925-
long long i;
926-
for (i=0; i<ndims; i++) {
927-
len *= RAI_TensorDim(t, i);
928-
}
929906

930907
const char* tag = "";
931908
if (AC_AdvanceIfMatch(&ac, "TAG")) {
@@ -951,10 +928,6 @@ int RedisAI_ModelSet_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv,
951928
return RedisModule_ReplyWithError(ctx, "ERR Invalid argument for MINBATCHSIZE");
952929
}
953930
}
954-
RedisModule_CloseKey(key);
955-
956-
return REDISMODULE_OK;
957-
}
958931

959932

960933
if (AC_IsAtEnd(&ac)) {
@@ -1080,11 +1053,8 @@ int RedisAI_ModelSet_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv,
10801053

10811054
RedisModule_ReplicateVerbatim(ctx);
10821055

1083-
size_t ninputs = inac.argc;
1084-
const char *inputs[ninputs];
1085-
for (size_t i=0; i<ninputs; i++) {
1086-
AC_GetString(&inac, inputs+i, NULL, 0);
1087-
}
1056+
return REDISMODULE_OK;
1057+
}
10881058

10891059
/**
10901060
* AI.MODELGET model_key [META | BLOB]
@@ -1107,8 +1077,6 @@ int RedisAI_ModelGet_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv,
11071077
else if (!strcasecmp(optstr, "BLOB")) {
11081078
blob = 1;
11091079
}
1110-
RAI_ClearError(&err);
1111-
model = RAI_ModelCreate(backend, devicestr, tag, opts, ninputs, inputs, noutputs, outputs, modeldef, modellen, &err);
11121080
}
11131081

11141082
RAI_Error err = {0};
@@ -1259,7 +1227,7 @@ int RedisAI_Parse_ModelRun_RedisCommand(RedisModuleCtx *ctx,
12591227
}
12601228
RedisModule_CloseKey(tensorKey);
12611229
} else {
1262-
const int get_result = RAI_GetTensorFromLocalContext(
1230+
const int get_result = RAI_getTensorFromLocalContext(
12631231
ctx, *localContextDict, arg_string, &inputTensor);
12641232
if (get_result == REDISMODULE_ERR) {
12651233
return -1;
@@ -1970,7 +1938,7 @@ int RedisAI_DagRun_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv,
19701938
const char *key_string = RedisModule_StringPtrLen(argv[argpos + 1], NULL);
19711939
RAI_Tensor *t = NULL;
19721940
const int get_result =
1973-
RAI_GetTensorFromLocalContext(ctx, dagTensorsContext, key_string, &t);
1941+
RAI_getTensorFromLocalContext(ctx, dagTensorsContext, key_string, &t);
19741942
if (get_result == REDISMODULE_OK) {
19751943
const int parse_result =
19761944
RAI_parseTensorGetArgs(ctx, &argv[argpos], argc - argpos, t);

0 commit comments

Comments
 (0)