-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Index* for new types #461
Index* for new types #461
Conversation
cc: @wickedfoo |
|
||
for (long i = threadIdx.x; i < sliceSize; i += blockDim.x) { | ||
// Torch indices are 1-based (hence the +1) | ||
base[i * sliceStride] = (float) i + 1.0f; | ||
base[i * sliceStride] = (long) i + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can remove the (long), it's already long
I think it looks good to me, besides the topk issues (it won't work for some tensors with more than 2^31 - 1 elements). should add an assertion to topk that you aren't calling it on a tensor where the slice size that you are top-k-ing is > 2^31 - 1 elements. (also sorry, github notifications have been going to my spam gmail for the past couple of months, hopefully i'll get them now) |
fixes #463 |
fixes jcjohnson/densecap#26 and jcjohnson/densecap#22 |
This makes the index* methods to use CudaLongTensor for indices.
Adds index* for all CUDA types (except indexAdd because need to implement atomicAdd for non float / int types)
Also changes the sort and topK API accordingly (but doesn't add new types in them yet)
Checklist before merging: