diff options
author | Determinant <[email protected]> | 2016-01-13 12:05:48 +0800 |
---|---|---|
committer | Determinant <[email protected]> | 2016-01-13 12:05:48 +0800 |
commit | 3f742c01540b8bad940d66331d562082a63d975b (patch) | |
tree | 25ed764f4ac9ee6694d8bff3745eafe5da5ae827 /speech_utils | |
parent | f9b78f6bc35cd5c0c117a5e523ef6aab96dee5c3 (diff) |
support pure CPU reader
Diffstat (limited to 'speech_utils')
-rw-r--r-- | speech_utils/init.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/speech_utils/init.lua b/speech_utils/init.lua index f89f4fd..9e8adba 100644 --- a/speech_utils/init.lua +++ b/speech_utils/init.lua @@ -9,8 +9,13 @@ function nerv.speech_utils.global_transf(feat_utter, global_transf, global_transf:init(input[1]:nrow()) global_transf:propagate(input, output) -- trim frames - expanded = gconf.cumat_type(output[1]:nrow() - frm_trim * 2, output[1]:ncol()) - expanded:copy_fromd(output[1], frm_trim, feat_utter:nrow() - frm_trim) + if gconf.use_cpu then + mat_type = gconf.mmat_type + else + mat_type = gconf.cumat_type + end + expanded = mat_type(output[1]:nrow() - frm_trim * 2, output[1]:ncol()) + expanded:copy_from(output[1], frm_trim, feat_utter:nrow() - frm_trim) collectgarbage("collect") return expanded end |