mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Revert "don't check memory format for empty tensors (#126593)"
This reverts commit12dee4f204. Reverted https://github.com/pytorch/pytorch/pull/126593 on behalf of https://github.com/clee2000 due to broke tests on inductor? test_modules.py::TestModuleCUDA::test_cpu_gpu_parity_nn_CTCLoss_cuda_float6443f2f43eb3https://github.com/pytorch/pytorch/actions/runs/9200644034/job/25308511495 ([comment](https://github.com/pytorch/pytorch/pull/126586#issuecomment-2126228689))
This commit is contained in:
parent
df4b7cb5f7
commit
b1e214ceb1
|
|
@ -663,10 +663,10 @@ class TestModule(TestCase):
|
||||||
d = output.dim()
|
d = output.dim()
|
||||||
if (d == 4 and ((input_mem_format == torch.channels_last)
|
if (d == 4 and ((input_mem_format == torch.channels_last)
|
||||||
or (module_mem_format == torch.channels_last and module_memformat_affects_out))):
|
or (module_mem_format == torch.channels_last and module_memformat_affects_out))):
|
||||||
self.assertTrue(output.numel() == 0 or output.is_contiguous(memory_format=torch.channels_last))
|
self.assertTrue(output.is_contiguous(memory_format=torch.channels_last))
|
||||||
elif (d == 5 and ((input_mem_format == torch.channels_last_3d)
|
elif (d == 5 and ((input_mem_format == torch.channels_last_3d)
|
||||||
or (module_mem_format == torch.channels_last_3d and module_memformat_affects_out))):
|
or (module_mem_format == torch.channels_last_3d and module_memformat_affects_out))):
|
||||||
self.assertTrue(output.numel() == 0 or output.is_contiguous(memory_format=torch.channels_last_3d))
|
self.assertTrue(output.is_contiguous(memory_format=torch.channels_last_3d))
|
||||||
else:
|
else:
|
||||||
self.assertTrue(output.is_contiguous())
|
self.assertTrue(output.is_contiguous())
|
||||||
return self._traverse_obj(output, inner_check_out_mem_format)
|
return self._traverse_obj(output, inner_check_out_mem_format)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user