summaryrefslogtreecommitdiff
path: root/tnet_io
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2015-06-24 22:45:18 +0800
committerDeterminant <[email protected]>2015-06-24 22:45:43 +0800
commitb6301089cde20f4c825c7f5deaf179082aad63da (patch)
treeb50b8b476cbf5f0a6bb7d866152dd53eeb91caab /tnet_io
parent32eac093cc431849a92e5a2297c5fe646fd60556 (diff)
use libnervcore & libluaT
Diffstat (limited to 'tnet_io')
-rw-r--r--tnet_io/cwrapper.cpp10
-rw-r--r--tnet_io/cwrapper.h2
-rw-r--r--tnet_io/init.c2
3 files changed, 9 insertions, 5 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);
diff --git a/tnet_io/cwrapper.h b/tnet_io/cwrapper.h
index 01371ec..a52770b 100644
--- a/tnet_io/cwrapper.h
+++ b/tnet_io/cwrapper.h
@@ -1,6 +1,6 @@
#ifndef NERV_TNET_IO_CWRAPPER
#define NERV_TNET_IO_CWRAPPER
-#include "../../nerv/matrix/generic/matrix.h"
+#include "../../nerv/lib/matrix/matrix.h"
#include "../../nerv/common.h"
#ifdef __cplusplus
extern "C" {
diff --git a/tnet_io/init.c b/tnet_io/init.c
index 5251d1e..3e3f90d 100644
--- a/tnet_io/init.c
+++ b/tnet_io/init.c
@@ -4,7 +4,7 @@
const char *nerv_tnet_feat_repo_tname = "nerv.TNetFeatureRepo";
const char *nerv_tnet_label_repo_tname = "nerv.TNetLabelRepo";
-extern const char *nerv_matrix_host_float_tname;
+const char *nerv_matrix_host_float_tname = "nerv.MMatrixFloat";
static int feat_repo_new(lua_State *L) {
const char *scp_file = luaL_checkstring(L, 1);