Skip to content

Fix negative indices in tracer#10560

Closed
eellison wants to merge 4 commits intopytorch:masterfrom
eellison:fix_negative_indices_in_tracer
Closed

Fix negative indices in tracer#10560
eellison wants to merge 4 commits intopytorch:masterfrom
eellison:fix_negative_indices_in_tracer

Conversation

@eellison
Copy link
Contributor

Previously when tracing slicing & select negative indices would get normalized, fixing the index to the size of the traced tensor. This makes the behavior the same as script so aten::select with negative indices is emitted.

Copy link
Contributor

@apaszke apaszke left a comment

Choose a reason for hiding this comment

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

Nice one!

Copy link
Contributor

@apaszke apaszke left a comment

Choose a reason for hiding this comment

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

Realized the tests are not strict enough

test/test_jit.py Outdated

This comment was marked as off-topic.

@eellison eellison force-pushed the fix_negative_indices_in_tracer branch 11 times, most recently from 75a2b60 to c3482bd Compare August 23, 2018 00:49
Copy link
Contributor

@zdevito zdevito left a comment

Choose a reason for hiding this comment

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

Seems good now.

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.

eellison is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

This comment was marked as off-topic.

@eellison eellison force-pushed the fix_negative_indices_in_tracer branch from c3482bd to 38433b4 Compare August 24, 2018 16:41
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.

eellison is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

PenghuiCheng pushed a commit to PenghuiCheng/pytorch that referenced this pull request Sep 11, 2018
Summary:
Previously when tracing slicing & select negative indices would get normalized, fixing the index to the size of the traced tensor. This makes the behavior the same as script so aten::select with negative indices is emitted.
Pull Request resolved: pytorch#10560

Differential Revision: D9493614

Pulled By: eellison

fbshipit-source-id: ce7a8bae59863723247208d86b9f2948051ccc6c
@ezyang ezyang added the merged label Jun 26, 2019
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.

5 participants