{"action":"created","issue":{"url":"https://api.github.com/repos/torch/nn/issues/1077","repository_url":"https://api.github.com/repos/torch/nn","labels_url":"https://api.github.com/repos/torch/nn/issues/1077/labels{/name}","comments_url":"https://api.github.com/repos/torch/nn/issues/1077/comments","events_url":"https://api.github.com/repos/torch/nn/issues/1077/events","html_url":"https://github.com/torch/nn/issues/1077","id":197317364,"number":1077,"title":"unable to convert argument 3 from cdata<struct THCudaLongTensor*> to cdata<struct THCudaTensor*>","user":{"login":"pby5","id":5305941,"avatar_url":"https://avatars.githubusercontent.com/u/5305941?v=3","gravatar_id":"","url":"https://api.github.com/users/pby5","html_url":"https://github.com/pby5","followers_url":"https://api.github.com/users/pby5/followers","following_url":"https://api.github.com/users/pby5/following{/other_user}","gists_url":"https://api.github.com/users/pby5/gists{/gist_id}","starred_url":"https://api.github.com/users/pby5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pby5/subscriptions","organizations_url":"https://api.github.com/users/pby5/orgs","repos_url":"https://api.github.com/users/pby5/repos","events_url":"https://api.github.com/users/pby5/events{/privacy}","received_events_url":"https://api.github.com/users/pby5/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-23T06:03:57Z","updated_at":"2016-12-23T14:45:07Z","closed_at":null,"body":"my code is below:\r\nrequire 'nn'; \r\nrequire 'cunn'\r\nbatch_size = 2\r\na = torch.FloatTensor({0.5, 0.5, 0.7, 0.3}):view(batch_size, -1):cuda()\r\nb = torch.FloatTensor({1, 1}):cuda()\r\nc = nn.ClassNLLCriterion():cuda()\r\nd = nn.LogSoftMax():cuda()\r\ne = nn.CrossEntropyCriterion():cuda()\r\nc:forward(d:forward(a), b)\r\nd:forward(a)  -- log softmax\r\ne:forward(a, b)\r\n\r\nand it exists an error:/home/gavinpan/torch/install/bin/lua: unable to convert argument 3 from cdata<struct THCudaLongTensor*> to cdata<struct THCudaTensor*>\r\nstack traceback:\r\n\t[C]: in function 'v'\r\n\t/home/gavinpan/torch/install/share/lua/5.2/nn/THNN.lua:110: in function 'ClassNLLCriterion_updateOutput'\r\n\t...pan/torch/install/share/lua/5.2/nn/ClassNLLCriterion.lua:44: in function <...pan/torch/install/share/lua/5.2/nn/ClassNLLCriterion.lua:29>\r\n\t(...tail calls...)\r\n\r\nwhy CudaLongTensor and I use CudaTensor?\r\n"},"comment":{"url":"https://api.github.com/repos/torch/nn/issues/comments/268999865","html_url":"https://github.com/torch/nn/issues/1077#issuecomment-268999865","issue_url":"https://api.github.com/repos/torch/nn/issues/1077","id":268999865,"user":{"login":"soumith","id":1310570,"avatar_url":"https://avatars.githubusercontent.com/u/1310570?v=3","gravatar_id":"","url":"https://api.github.com/users/soumith","html_url":"https://github.com/soumith","followers_url":"https://api.github.com/users/soumith/followers","following_url":"https://api.github.com/users/soumith/following{/other_user}","gists_url":"https://api.github.com/users/soumith/gists{/gist_id}","starred_url":"https://api.github.com/users/soumith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soumith/subscriptions","organizations_url":"https://api.github.com/users/soumith/orgs","repos_url":"https://api.github.com/users/soumith/repos","events_url":"https://api.github.com/users/soumith/events{/privacy}","received_events_url":"https://api.github.com/users/soumith/received_events","type":"User","site_admin":false},"created_at":"2016-12-23T14:45:07Z","updated_at":"2016-12-23T14:45:07Z","body":"@jonghyuk65 it is convenient to just go to cd ~/torch; ./update.sh; ./clean.sh; ./install.sh"}}
{"actor":{"display_login":"soumith"}}