ROCm / pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration
http://pytorch.org
Other
219 stars 50 forks source link

don't check memory format for empty tensors (#126593) #1426

Closed pragupta closed 1 month ago

pragupta commented 1 month ago

This is a cherry-pick of an upstream commit to fix https://ontrack-internal.amd.com/browse/SWDEV-462482

Fix https://github.com/pytorch/pytorch/issues/125967 . The test actually fail for empty 4D or 5D tensors when checking for memory format.

I'm not exactly sure what recent inductor change cause the failure, but it may be not that important to maintain strides for an empty tensor. (?)

I just skip the check for empty tensor.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/126593 Approved by: https://github.com/ezyang

Fixes #ISSUE_NUMBER