Skip to content

Commit

Permalink
Update demo.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Vondrick committed Nov 17, 2016
1 parent a8d7fea commit 4f9fed2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion demo.lua
Expand Up @@ -21,7 +21,7 @@ print(net)
local sound = audio.load('demo.mp3')

-- data preprocessing
if sound:size(2) > 1 then sound = sound:select(2,1) end -- select first channel (mono)
if sound:size(2) > 1 then sound = sound:select(2,1):clone() end -- select first channel (mono)
sound:mul(2^-23) -- make range [-256, 256]
sound = sound:view(1, 1, -1, 1) -- shape to BatchSize x 1 x DIM x 1
sound = sound:cuda() -- ship to GPU
Expand Down

0 comments on commit 4f9fed2

Please sign in to comment.