{"action":"opened","issue":{"url":"https://api.github.com/repos/torch/nn/issues/694","repository_url":"https://api.github.com/repos/torch/nn","labels_url":"https://api.github.com/repos/torch/nn/issues/694/labels{/name}","comments_url":"https://api.github.com/repos/torch/nn/issues/694/comments","events_url":"https://api.github.com/repos/torch/nn/issues/694/events","html_url":"https://github.com/torch/nn/issues/694","id":138856203,"number":694,"title":"LookupTable calls THNN incorrectly?","user":{"login":"dieterichlawson","id":147440,"avatar_url":"https://avatars.githubusercontent.com/u/147440?v=3","gravatar_id":"","url":"https://api.github.com/users/dieterichlawson","html_url":"https://github.com/dieterichlawson","followers_url":"https://api.github.com/users/dieterichlawson/followers","following_url":"https://api.github.com/users/dieterichlawson/following{/other_user}","gists_url":"https://api.github.com/users/dieterichlawson/gists{/gist_id}","starred_url":"https://api.github.com/users/dieterichlawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dieterichlawson/subscriptions","organizations_url":"https://api.github.com/users/dieterichlawson/orgs","repos_url":"https://api.github.com/users/dieterichlawson/repos","events_url":"https://api.github.com/users/dieterichlawson/events{/privacy}","received_events_url":"https://api.github.com/users/dieterichlawson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-07T00:51:30Z","updated_at":"2016-03-07T00:51:30Z","closed_at":null,"body":"When backpropogating through a LookupTable using CUDA I get the error:\r\n\r\n```\r\nluajit: /home/ubuntu/torch/install/share/lua/5.1/nn/THNN.lua:1091: bad argument #5 to 'v' (cannot convert 'struct THCudaTensor *' to 'float')\r\nstack traceback:\r\n\t[C]: in function 'v'\r\n\t/home/ubuntu/torch/install/share/lua/5.1/nn/THNN.lua:1091: in function 'LookupTable_accGradParameters'\r\n\t/home/ubuntu/torch/install/share/lua/5.1/nn/LookupTable.lua:85: in function 'accGradParameters'\r\n\t/home/ubuntu/torch/install/share/lua/5.1/nn/Module.lua:31: in function 'backward'\r\n\t/home/ubuntu/torch/install/share/lua/5.1/nn/Sequential.lua:88: in function 'backward'\r\n\ttrain.lua:144: in function 'opfunc'\r\n\t/home/ubuntu/torch/install/share/lua/5.1/optim/adam.lua:33: in function 'adam'\r\n\ttrain.lua:191: in main chunk\r\n\t[C]: at 0x00406670\r\n```\r\nWhen I investigated, `LookupTable` seemed to be calling its `accGradParameters` method in `THNN`, but was not including the required `state` argument as the first argument.\r\n\r\nI checked the C implementation in `LookupTable.c` and it doesn't appear to use the state argument. Is this an error?"}}