Skip to content

Conversation

@colesbury
Copy link
Member

Fixes #4386


int srcDims = THCTensor_(nDimension)(state, src);
THArgCheck(srcDims > 0, 2, "Source tensor is empty");
if (THCTensor_(numel)(state, src) == 0) {

This comment was marked as off-topic.

Copy link
Contributor

@gchanan gchanan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice to eventually move these functions to ATen native; The dispatch code should handle empty tensors and scalars correctly and you only need to write the error checking once.

@colesbury colesbury merged commit b8fd57a into pytorch:master Jan 5, 2018
@colesbury colesbury deleted the index_empty branch January 5, 2018 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants