Skip to content

Commit 1fbb4eb

Browse files
itamarhaberlantiga
authored andcommitted
Model runner fixes (#107)
As coded during RedisConf19 Signed-off-by: Itamar Haber <itamar@redislabs.com>
1 parent a5a05a3 commit 1fbb4eb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/model.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -218,23 +218,23 @@ RAI_ModelRunCtx* RAI_ModelRunCtxCreate(RAI_Model* model) {
218218
return mctx;
219219
}
220220

221-
static int Model_RunCtxAddParam(RAI_ModelRunCtx* mctx, RAI_ModelCtxParam* paramArr,
221+
static int Model_RunCtxAddParam(RAI_ModelRunCtx* mctx, RAI_ModelCtxParam** paramArr,
222222
const char* name, RAI_Tensor* tensor) {
223223

224224
RAI_ModelCtxParam param = {
225225
.name = name,
226226
.tensor = tensor ? RAI_TensorGetShallowCopy(tensor): NULL,
227227
};
228-
paramArr = array_append(paramArr, param);
228+
*paramArr = array_append(*paramArr, param);
229229
return 1;
230230
}
231231

232232
int RAI_ModelRunCtxAddInput(RAI_ModelRunCtx* mctx, const char* inputName, RAI_Tensor* inputTensor) {
233-
return Model_RunCtxAddParam(mctx, mctx->inputs, inputName, inputTensor);
233+
return Model_RunCtxAddParam(mctx, &mctx->inputs, inputName, inputTensor);
234234
}
235235

236236
int RAI_ModelRunCtxAddOutput(RAI_ModelRunCtx* mctx, const char* outputName) {
237-
return Model_RunCtxAddParam(mctx, mctx->outputs, outputName, NULL);
237+
return Model_RunCtxAddParam(mctx, &mctx->outputs, outputName, NULL);
238238
}
239239

240240
size_t RAI_ModelRunCtxNumOutputs(RAI_ModelRunCtx* mctx) {

0 commit comments

Comments
 (0)