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.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/tnet_io/cwrapper.cpp b/tnet_io/cwrapper.cpp
index 4149557..800df2e 100644
--- a/tnet_io/cwrapper.cpp
+++ b/tnet_io/cwrapper.cpp
@@ -53,7 +53,7 @@ extern "C" {
return repo;
}
- Matrix *tnet_feature_repo_read_utterance(TNetFeatureRepo *repo, lua_State *L) {
+ Matrix *tnet_feature_repo_read_utterance(TNetFeatureRepo *repo, lua_State *L, int debug) {
Matrix *mat; /* nerv implementation */
repo->feature_repo.ReadFullMatrix(repo->feats_host);
std::string utter_str = repo->feature_repo.Current().Logical();
@@ -62,7 +62,8 @@ extern "C" {
int m = repo->feats_host.Cols();
mat = nerv_matrix_host_float_new_(L, n, m);
size_t stride = mat->stride;
- fprintf(stderr, "[tnet] feature: %s %d %d\n", utter_str.c_str(), n, m);
+ if (debug)
+ fprintf(stderr, "[tnet] feature: %s %d %d\n", utter_str.c_str(), n, m);
for (int i = 0; i < n; i++)
{
float *row = repo->feats_host.pRowData(i);
@@ -115,7 +116,8 @@ extern "C" {
size_t frames,
size_t sample_rate,
const char *tag,
- lua_State *L) {
+ lua_State *L,
+ int debug) {
std::vector<TNet::Matrix<float> > labs_hosts; /* KaldiLib implementation */
Matrix *mat;
repo->label_repo.GenDesiredMatrixExt(labs_hosts, frames,
@@ -124,7 +126,8 @@ extern "C" {
int m = labs_hosts[0].Cols();
mat = nerv_matrix_host_float_new_(L, n, m);
size_t stride = mat->stride;
- fprintf(stderr, "[tnet] label: %s %d %d\n", tag, n, m);
+ if (debug)
+ fprintf(stderr, "[tnet] label: %s %d %d\n", tag, n, m);
for (int i = 0; i < n; i++)
{
float *row = labs_hosts[0].pRowData(i);