summaryrefslogtreecommitdiff
path: root/speech_utils
diff options
context:
space:
mode:
Diffstat (limited to 'speech_utils')
-rw-r--r--speech_utils/init.lua9
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