{"action":"created","issue":{"url":"https://api.github.com/repos/hughperkins/cltorch/issues/62","repository_url":"https://api.github.com/repos/hughperkins/cltorch","labels_url":"https://api.github.com/repos/hughperkins/cltorch/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/hughperkins/cltorch/issues/62/comments","events_url":"https://api.github.com/repos/hughperkins/cltorch/issues/62/events","html_url":"https://github.com/hughperkins/cltorch/issues/62","id":147748297,"number":62,"title":"Workaround for torch.sort()?","user":{"login":"coodoo","id":325936,"avatar_url":"https://avatars.githubusercontent.com/u/325936?v=3","gravatar_id":"","url":"https://api.github.com/users/coodoo","html_url":"https://github.com/coodoo","followers_url":"https://api.github.com/users/coodoo/followers","following_url":"https://api.github.com/users/coodoo/following{/other_user}","gists_url":"https://api.github.com/users/coodoo/gists{/gist_id}","starred_url":"https://api.github.com/users/coodoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coodoo/subscriptions","organizations_url":"https://api.github.com/users/coodoo/orgs","repos_url":"https://api.github.com/users/coodoo/repos","events_url":"https://api.github.com/users/coodoo/events{/privacy}","received_events_url":"https://api.github.com/users/coodoo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-04-12T13:16:54Z","updated_at":"2016-04-14T00:07:41Z","closed_at":null,"body":"I tried to run following test script to make predictions with a opencl-trained model:\r\n\r\n```lua\r\nmlp:cl()\r\nlocal outputs = mlp:forward(inputs[1]):exp()\r\nlocal probs, idx = torch.sort( outputs, true )\r\n```\r\nbut got this error message `torch.ClTensor does not implement the torch.sort()`, current workaround is to move the model back to CPU using `mlp:float()` but it quickly become rather tedious, just wondering if there's better way to do it? Maybe a pure OpenCL way of sorting?"},"comment":{"url":"https://api.github.com/repos/hughperkins/cltorch/issues/comments/209696857","html_url":"https://github.com/hughperkins/cltorch/issues/62#issuecomment-209696857","issue_url":"https://api.github.com/repos/hughperkins/cltorch/issues/62","id":209696857,"user":{"login":"coodoo","id":325936,"avatar_url":"https://avatars.githubusercontent.com/u/325936?v=3","gravatar_id":"","url":"https://api.github.com/users/coodoo","html_url":"https://github.com/coodoo","followers_url":"https://api.github.com/users/coodoo/followers","following_url":"https://api.github.com/users/coodoo/following{/other_user}","gists_url":"https://api.github.com/users/coodoo/gists{/gist_id}","starred_url":"https://api.github.com/users/coodoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coodoo/subscriptions","organizations_url":"https://api.github.com/users/coodoo/orgs","repos_url":"https://api.github.com/users/coodoo/repos","events_url":"https://api.github.com/users/coodoo/events{/privacy}","received_events_url":"https://api.github.com/users/coodoo/received_events","type":"User","site_admin":false},"created_at":"2016-04-14T00:07:41Z","updated_at":"2016-04-14T00:07:41Z","body":"\r\nHaha, actually I'm curious about `exp` too, was just following coursera's code sample [here](https://github.com/torch/tutorials/blob/master/coursera_neural_nets/assignment2/solution_torch_nn/predict_next_word.lua#L34-L36).\r\n\r\nPs. I thought the purpose of `exp` is to make something negative become positive?"}}