Skip to content

Conversation

@izdeby
Copy link
Contributor

@izdeby izdeby commented Jun 10, 2019

Fixing reported bug
The issue was related to not checking the dimensions of source vs destination tensors.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@izdeby has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

VitalyFedyunin
VitalyFedyunin previously approved these changes Jun 10, 2019
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@izdeby has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@VitalyFedyunin
Copy link
Contributor

Test fail seems legit: ERROR: test_index_copy_scalar_input_dim (__main__.TestAutograd)

@VitalyFedyunin VitalyFedyunin dismissed their stale review June 11, 2019 00:33

Test fails

if (source.dim() == 0 && numIndices != 1) {
AT_INDEX_ERROR("index_copy_(): When source is scalar, index should have one element (got ", numIndices, ")");
} else if (source.dim() != self.dim()) {
AT_INDEX_ERROR("index_copy_(): When source is not scalar, its dimensionality must match the dimensionality of the destination");
Copy link
Contributor

Choose a reason for hiding this comment

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

It's nice to also list the dimensionalities so the user doesn't have to print out the tensors.
Something like:

index_copy_(): When source is not scalar, its dimensionality (3) must match the dimensionality of the destination (2)"

Copy link
Contributor

Choose a reason for hiding this comment

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

also, the error message doesn't match what is checked -- the message says source is not a scalar, but this isn't actually checked.

@ezyang ezyang requested review from VitalyFedyunin and zou3519 and removed request for ezyang June 11, 2019 14:09
Copy link
Contributor

@VitalyFedyunin VitalyFedyunin left a comment

Choose a reason for hiding this comment

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

Test fail seems legit: ERROR: test_index_copy_scalar_input_dim (__main__.TestAutograd)

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.

test?

@izdeby izdeby changed the title Added dim check for index_copy_ [WIP] Added dim check for index_copy_ Jun 11, 2019
@izdeby izdeby changed the title [WIP] Added dim check for index_copy_ Added dim check for index_copy_ Jun 13, 2019
@izdeby izdeby requested review from VitalyFedyunin and gchanan June 13, 2019 14:59
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@izdeby has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@ssnl
Copy link
Collaborator

ssnl commented Jun 13, 2019

why does this not have a test?

zdevito pushed a commit to zdevito/ATen that referenced this pull request Jun 13, 2019
Summary:
Fixing reported [bug](pytorch/pytorch#20322)
The issue was related to not checking the dimensions of source vs destination tensors.
Pull Request resolved: pytorch/pytorch#21617

Differential Revision: D15749963

Pulled By: izdeby

fbshipit-source-id: acff114c729fd9c0a9a51325e0ebd8b42e1f2fc1
@facebook-github-bot
Copy link
Contributor

@izdeby merged this pull request in 4b45f08.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants