Closed cvondrick closed 8 years ago
The problem is in here https://github.com/torch/nn/blob/master/MM.lua#L51 gradInput is an empty table after clearState, and here it's supposed to be a table with two tensors. the simplest is to lazily initialize gradInput in the backward
We are experiencing a crash in the backward pass of MM after calling :clearState on the network.
Minimal code to reproduce:
If you change the nn.MM to something else, such as nn.CAddTable(), there is no crash.
The code works fine until :clearState() is called. The crash happens with/without cunn/cuda.
Thank you very much!