add complex32 to v3_dtypes (#120388)

Fixes [#120290](https://github.com/pytorch/pytorch/issues/120290)
Fixes https://github.com/pytorch/pytorch/issues/73502

use `v3_dtypes` and `torch._utils._rebuild_tensor_v3` to handle torch.save(complex32)

result:
![image](https://github.com/pytorch/pytorch/assets/37650440/18b6cbb3-fb3f-4855-9d48-374014647988)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/120388
Approved by: https://github.com/albanD
This commit is contained in:
feifan
2024-02-28 02:32:25 +00:00
committed by PyTorch MergeBot
parent 5a53c0ff23
commit bfa71b523d
3 changed files with 2 additions and 7 deletions

View File

@ -3524,8 +3524,6 @@ module_db: List[ModuleInfo] = [
# Not implmented for chalf on CPU
DecorateInfo(unittest.expectedFailure, 'TestModule', 'test_cpu_gpu_parity',
dtypes=(torch.chalf,), device_type='cuda'),
# Ref: https://github.com/pytorch/pytorch/issues/73502
DecorateInfo(unittest.expectedFailure, 'TestModule', 'test_pickle', dtypes=(torch.chalf,)),
# See #119108: MPSNDArrayConvolutionA14.mm:3976: failed assertion `destination datatype must be fp32'
# xfail does not work due to Fatal Python error: Aborted
DecorateInfo(skipIfMps, "TestModule", "test_memory_format",
@ -3559,8 +3557,6 @@ module_db: List[ModuleInfo] = [
# Not implemented for chalf on CPU
DecorateInfo(unittest.expectedFailure, 'TestModule', 'test_cpu_gpu_parity',
dtypes=(torch.chalf,), device_type='cuda'),
# Ref: https://github.com/pytorch/pytorch/issues/73502
DecorateInfo(unittest.expectedFailure, 'TestModule', 'test_pickle', dtypes=(torch.chalf,)),
# See #119108: MPSNDArrayConvolutionA14.mm:3976: failed assertion `destination datatype must be fp32'
# xfail does not work due to Fatal Python error: Aborted
DecorateInfo(skipIfMps, "TestModule", "test_memory_format",
@ -3593,8 +3589,6 @@ module_db: List[ModuleInfo] = [
# Not implmented for chalf on CPU
DecorateInfo(unittest.expectedFailure, 'TestModule', 'test_cpu_gpu_parity',
dtypes=(torch.chalf,), device_type='cuda'),
# Ref: https://github.com/pytorch/pytorch/issues/73502
DecorateInfo(unittest.expectedFailure, 'TestModule', 'test_pickle', dtypes=(torch.chalf,)),
),
decorators=(
DecorateInfo(precisionOverride({torch.float32: 1e-04}), 'TestModule', 'test_memory_format'),