From 41a841f3e0992a578cf5c8f82ae44a552a6f8b2f Mon Sep 17 00:00:00 2001 From: txh18 Date: Wed, 2 Dec 2015 15:23:54 +0800 Subject: changed thres_mask function of matrix to a more standard api --- nerv/matrix/generic/cumatrix.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'nerv/matrix/generic/cumatrix.c') diff --git a/nerv/matrix/generic/cumatrix.c b/nerv/matrix/generic/cumatrix.c index d1f763b..fb36033 100644 --- a/nerv/matrix/generic/cumatrix.c +++ b/nerv/matrix/generic/cumatrix.c @@ -65,10 +65,11 @@ static int nerv_matrix_(lua_sigmoid_grad)(lua_State *L) { static int nerv_matrix_(lua_thres_mask)(lua_State *L) { Status status; Matrix *a = luaT_checkudata(L, 1, nerv_matrix_(tname)); - MATRIX_ELEM thres = luaL_checknumber(L, 2); - MATRIX_ELEM low = luaL_checknumber(L, 3); - MATRIX_ELEM high = luaL_checknumber(L, 4); - nerv_matrix_(thres_mask)(a, thres, low, high, &status); + Matrix *b = luaT_checkudata(L, 2, nerv_matrix_(tname)); + MATRIX_ELEM thres = luaL_checknumber(L, 3); + MATRIX_ELEM low = luaL_checknumber(L, 4); + MATRIX_ELEM high = luaL_checknumber(L, 5); + nerv_matrix_(thres_mask)(a, b, thres, low, high, &status); NERV_LUA_CHECK_STATUS(L, status); return 0; } -- cgit v1.2.3-70-g09d2