Skip to content

Conversation

jjsjann123
Copy link
Collaborator

The old implementation assumed is_channels_last_contiguous_ to be mutually
exclusive to is_contiguous_, which is not true.
Properly set the flag by checking strides.

The old implementation assumed `is_channels_last_contiguous_` to be mutually
exclusive to `is_contiguous_`, which is not true.
Properly set the flag by checking strides.
@pytorchbot pytorchbot added the module: internals Related to internal abstractions in c10 and ATen label Aug 9, 2019
@jerryzh168 jerryzh168 added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Aug 12, 2019
@jjsjann123
Copy link
Collaborator Author

Realized that I forgot to tag @VitalyFedyunin
Bug fixing supporting #23403

self.assertTrue(nhwc.is_contiguous(memory_format=torch.channels_last))
self.assertEqual(nhwc, x)

def test_memory_format_consistency(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Wait, does this test fails if we remove all TensorImpl.h changes

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, that's the issue I was complaining (along with the ambiguity things) earlier last week.

I guess I didn't make it clear enough back then. :)

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.

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

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.

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

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.

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

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.

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

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.

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

@ailzhang
Copy link
Contributor

ailzhang commented Sep 4, 2019

cc: @VitalyFedyunin this PR is not landed yet, is this expected ? (internal diff is in preparation).

@VitalyFedyunin
Copy link
Contributor

It is expected, please do not land it yet.

@jjsjann123
Copy link
Collaborator Author

jjsjann123 commented Oct 18, 2019

Rebased my code and cherry-picked the patch from #25102
Commented on the wrong PR, sorry about that. 😝

@VitalyFedyunin
Copy link
Contributor

Please rebase and retitle to something like: 'Revoking mutually
exclusive requirement on channels last and contiguous tensor'.

@jjsjann123 jjsjann123 changed the title [Fixing is_channels_last_contiguous_ & is_channels_last_ flag] [NHWC support] Revoking mutually exclusive requirement on channels last and contiguous tensor Oct 21, 2019
@jjsjann123
Copy link
Collaborator Author

@VitalyFedyunin This one should be good to go.

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.

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

@VitalyFedyunin
Copy link
Contributor

Fails inner caffe2 tests, trying to figure out now what need to be fixed.

VitalyFedyunin added a commit to VitalyFedyunin/pytorch that referenced this pull request Nov 7, 2019
…us tensor

Summary:
The old implementation assumed `is_channels_last_contiguous_` to be mutually
exclusive to `is_contiguous_`, which is not true.
Properly set the flag by checking strides.

Original Pull Request resolved: pytorch#24113
Original GitHub Author: jjsjann123 <jiej@nvidia.com>

Differential Revision: D16860715

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

@VitalyFedyunin merged this pull request in ddeeb56.

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

Labels

Merged module: internals Related to internal abstractions in c10 and ATen open source triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants