lua---nnx icon indicating copy to clipboard operation
lua---nnx copied to clipboard

PullTable:cuda() yields infinite recursion

Open davidBelanger opened this issue 9 years ago • 1 comments

Paired PullTable and PushTable instances each have pointers to each other. This means that when we call pullTable:cuda(), it calls :cuda() on the corresponding PushTable, which calls, :cuda() on the PullTable, etc. This leads to infinite recursion!

The problem occurs for any type casting of the module, eg. PullTable:float()

This wasn't an issue until recently when the implementation of nn.Module:type() was changed. I'm not sure if the fix is to change the PullTable/PushTable implementations or to change the Module:type() implementation.

davidBelanger avatar Jul 21 '15 18:07 davidBelanger

this is a fun problem to have. We'll see how to fix this...!

soumith avatar Jul 31 '15 13:07 soumith