summaryrefslogtreecommitdiff
path: root/tnet_io/init.c
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2015-06-05 10:58:38 +0800
committerDeterminant <[email protected]>2015-06-05 10:58:38 +0800
commitbe0e51156e1af9d619160bba1aa7c2eb2df30731 (patch)
tree95f54f08291479480b11d0266ca3b5cc3dec4352 /tnet_io/init.c
parenta753eca0121ac3ec81ed76bd719d3f1cb9522680 (diff)
add debug flag
Diffstat (limited to 'tnet_io/init.c')
-rw-r--r--tnet_io/init.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tnet_io/init.c b/tnet_io/init.c
index 16f6f37..da93b35 100644
--- a/tnet_io/init.c
+++ b/tnet_io/init.c
@@ -29,7 +29,11 @@ static int feat_repo_current_tag(lua_State *L) {
static int feat_repo_current_utterance(lua_State *L) {
TNetFeatureRepo *repo = luaT_checkudata(L, 1, nerv_tnet_feat_repo_tname);
- Matrix *utter = tnet_feature_repo_read_utterance(repo, L);
+ int debug;
+ if (!lua_isboolean(L, 2))
+ nerv_error(L, "debug flag should be a boolean");
+ debug = lua_toboolean(L, 2);
+ Matrix *utter = tnet_feature_repo_read_utterance(repo, L, debug);
luaT_pushudata(L, utter, nerv_matrix_host_float_tname);
return 1;
}
@@ -71,10 +75,14 @@ static int label_repo_read_utterance(lua_State *L) {
TNetLabelRepo *repo = luaT_checkudata(L, 1, nerv_tnet_label_repo_tname);
TNetFeatureRepo *feat_repo = luaT_checkudata(L, 2, nerv_tnet_feat_repo_tname);
size_t frames = luaL_checkinteger(L, 3);
+ int debug;
+ if (!lua_isboolean(L, 4))
+ nerv_error(L, "debug flag should be a boolean");
+ debug = lua_toboolean(L, 4);
Matrix *utter = tnet_label_repo_read_utterance(repo,
frames,
tnet_feature_repo_current_samplerate(feat_repo),
- tnet_feature_repo_current_tag(feat_repo), L);
+ tnet_feature_repo_current_tag(feat_repo), L, debug);
luaT_pushudata(L, utter, nerv_matrix_host_float_tname);
return 1;
}