Skip to content

Conversation

@ssnl
Copy link
Collaborator

@ssnl ssnl commented Nov 1, 2017

Fixes #3416 .

Test:
Verified the snippet in #3416 runs on both cpu and cuda. Verified that TestTorch.test_advancedindex and TestCuda.test_advancedindex passes with the new inserted assertion.

This comment was marked as off-topic.

This comment was marked as off-topic.

@soumith soumith merged commit 8fd171a into pytorch:master Nov 6, 2017
@ssnl ssnl deleted the idx_empty branch November 6, 2017 19:22
THArgCheck(indices->nDimension == 1, 3, "Index is supposed to be a vector");
THArgCheck(indices->nDimension <= 1, 3, "Index is supposed to be an empty tensor or a vector");

THCudaLongTensor *indices_ = THCudaLongTensor_newWithSize1d(state, indices->size[0]);

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Indexing with an empty vector of indices throws a RuntimeError

5 participants