summaryrefslogtreecommitdiff
path: root/tnet_io/cwrapper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tnet_io/cwrapper.cpp')
-rw-r--r--tnet_io/cwrapper.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/tnet_io/cwrapper.cpp b/tnet_io/cwrapper.cpp
index 84e1d63..98ad864 100644
--- a/tnet_io/cwrapper.cpp
+++ b/tnet_io/cwrapper.cpp
@@ -10,7 +10,7 @@ extern "C" {
#include "string.h"
#include "../../nerv/common.h"
- extern Matrix *nerv_matrix_host_float_new_(lua_State *L, long nrow, long ncol);
+ extern Matrix *nerv_matrix_host_float_create(long nrow, long ncol, Status *status);
struct TNetFeatureRepo {
TNet::FeatureRepository feature_repo;
@@ -60,7 +60,9 @@ extern "C" {
repo->feats_host.CheckData(utter_str);
int n = repo->feats_host.Rows();
int m = repo->feats_host.Cols();
- mat = nerv_matrix_host_float_new_(L, n, m);
+ Status status;
+ mat = nerv_matrix_host_float_create(n, m, &status);
+ NERV_LUA_CHECK_STATUS(L, status);
size_t stride = mat->stride;
if (debug)
fprintf(stderr, "[tnet] feature: %s %d %d\n", utter_str.c_str(), n, m);
@@ -124,7 +126,9 @@ extern "C" {
sample_rate, tag);
int n = labs_hosts[0].Rows();
int m = labs_hosts[0].Cols();
- mat = nerv_matrix_host_float_new_(L, n, m);
+ Status status;
+ mat = nerv_matrix_host_float_create(n, m, &status);
+ NERV_LUA_CHECK_STATUS(L, status);
size_t stride = mat->stride;
if (debug)
fprintf(stderr, "[tnet] label: %s %d %d\n", tag, n, m);