{"action":"created","issue":{"url":"https://api.github.com/repos/torch/cutorch/issues/225","labels_url":"https://api.github.com/repos/torch/cutorch/issues/225/labels{/name}","comments_url":"https://api.github.com/repos/torch/cutorch/issues/225/comments","events_url":"https://api.github.com/repos/torch/cutorch/issues/225/events","html_url":"https://github.com/torch/cutorch/pull/225","id":102312248,"number":225,"title":"[RFC] Add generic CudaTensor types","user":{"login":"adamlerer","id":5702157,"avatar_url":"https://avatars.githubusercontent.com/u/5702157?v=3","gravatar_id":"","url":"https://api.github.com/users/adamlerer","html_url":"https://github.com/adamlerer","followers_url":"https://api.github.com/users/adamlerer/followers","following_url":"https://api.github.com/users/adamlerer/following{/other_user}","gists_url":"https://api.github.com/users/adamlerer/gists{/gist_id}","starred_url":"https://api.github.com/users/adamlerer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamlerer/subscriptions","organizations_url":"https://api.github.com/users/adamlerer/orgs","repos_url":"https://api.github.com/users/adamlerer/repos","events_url":"https://api.github.com/users/adamlerer/events{/privacy}","received_events_url":"https://api.github.com/users/adamlerer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-21T06:51:36Z","updated_at":"2015-08-23T17:11:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/torch/cutorch/pulls/225","html_url":"https://github.com/torch/cutorch/pull/225","diff_url":"https://github.com/torch/cutorch/pull/225.diff","patch_url":"https://github.com/torch/cutorch/pull/225.patch"},"body":"This is an RFC on a patch that will add support for all the torch7 tensor types to cutorch, with an eye to adding half-precision float support as well for Maxwell in a future PR.\r\n\r\nThe new tensor types are named e.g. `torch.CudaLongTensor`, and the conversion functions are named e.g. `:cudaLong()`. The Lua and C APIs for cuda float tensors is left unchanged for backwards compatibility, so cuda float tensors are still called `CudaTensor` (and `THCudaTensor`).\r\n\r\nOnly the construction, resize, and CPU copy/type-conversion API are implemented generically so far. I'll be adding some more stuff like FFI and GPU-GPU type-conversion (and tests), but I don't expect to implement the full cutorch math API generically any time soon.\r\n\r\nThanks!\r\n"},"comment":{"url":"https://api.github.com/repos/torch/cutorch/issues/comments/133879654","html_url":"https://github.com/torch/cutorch/pull/225#issuecomment-133879654","issue_url":"https://api.github.com/repos/torch/cutorch/issues/225","id":133879654,"user":{"login":"adamlerer","id":5702157,"avatar_url":"https://avatars.githubusercontent.com/u/5702157?v=3","gravatar_id":"","url":"https://api.github.com/users/adamlerer","html_url":"https://github.com/adamlerer","followers_url":"https://api.github.com/users/adamlerer/followers","following_url":"https://api.github.com/users/adamlerer/following{/other_user}","gists_url":"https://api.github.com/users/adamlerer/gists{/gist_id}","starred_url":"https://api.github.com/users/adamlerer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamlerer/subscriptions","organizations_url":"https://api.github.com/users/adamlerer/orgs","repos_url":"https://api.github.com/users/adamlerer/repos","events_url":"https://api.github.com/users/adamlerer/events{/privacy}","received_events_url":"https://api.github.com/users/adamlerer/received_events","type":"User","site_admin":false},"created_at":"2015-08-23T17:11:55Z","updated_at":"2015-08-23T17:11:55Z","body":"Dominik, I thought about having `torch.CudaFloatTensor` in addition to `torch.CudaTensor`. On the Lua side, you can't really alias, you'd  have to have two distinct torch types, which could both wrap the same C object; then every interfacing function would have to accept both types. I'd be worried that you'd end up with fragmentation where you could almost use the types interchangeably except for some random libraries that didn't support both \"aliases\" and suddenly you get confusing behavior.\r\n\r\nWhat do you think? Is this how you were thinking of doing the aliasing?"}}