Element-Research / rnn

Recurrent Neural Network library for Torch7's nn
BSD 3-Clause "New" or "Revised" License
941 stars 313 forks source link

SeqLSTM unstable GPU memory usage #402

Open liuxuan0526 opened 7 years ago

liuxuan0526 commented 7 years ago

https://github.com/Element-Research/rnn/blob/master/SeqLSTM.lua#L381

  self.grad_next_h = torch.mm(grad_a, Wh:t())

This line keeps allocating new GPU memory, which makes the GPU memory usage unstable. Replace with an inplace operation?