@@ -84,7 +84,7 @@ void *RedisAI_DagRunSession(RedisAI_RunInfo *rinfo) {
84
84
const char * key_string = RedisModule_StringPtrLen (
85
85
currentOp -> outkeys [outputNumber ], NULL );
86
86
const char * dictKey = RedisModule_Strdup (key_string );
87
- AI_dictReplace (rinfo -> dagTensorsContext , (void * )dictKey , tensor );
87
+ AI_dictReplace (rinfo -> dagTensorsContext , (void * )dictKey , RAI_TensorGetShallowCopy ( tensor ) );
88
88
} else {
89
89
RAI_SetError (currentOp -> err , RAI_EMODELRUN ,
90
90
"ERR output tensor on DAG's MODELRUN was null" );
@@ -126,7 +126,7 @@ void *RedisAI_DagRunSession(RedisAI_RunInfo *rinfo) {
126
126
const char * key_string = RedisModule_StringPtrLen (
127
127
currentOp -> outkeys [outputNumber ], NULL );
128
128
const char * dictKey = RedisModule_Strdup (key_string );
129
- AI_dictReplace (rinfo -> dagTensorsContext , (void * )dictKey , tensor );
129
+ AI_dictReplace (rinfo -> dagTensorsContext , (void * )dictKey , RAI_TensorGetShallowCopy ( tensor ) );
130
130
} else {
131
131
RAI_SetError (currentOp -> err , RAI_EMODELRUN ,
132
132
"ERR output tensor on DAG's SCRIPTRUN was null" );
@@ -329,7 +329,7 @@ int RAI_parseDAGLoadArgs(RedisModuleCtx *ctx, RedisModuleString **argv,
329
329
}
330
330
RedisModule_CloseKey (key );
331
331
const char * dictKey = RedisModule_Strdup (arg_string );
332
- AI_dictAdd (* localContextDict , (void * )dictKey , t );
332
+ AI_dictAdd (* localContextDict , (void * )dictKey , RAI_TensorGetShallowCopy ( t ) );
333
333
const char * keyspacePersistKey = RedisModule_Strdup (dictKey );
334
334
AI_dictAdd (* loadedContextDict , (void * )keyspacePersistKey , (void * )1 );
335
335
number_loaded_keys ++ ;
0 commit comments