Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cleanup][A-14] clean some VarType for test #61567

Merged
merged 2 commits into from
Feb 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix
  • Loading branch information
co63oc committed Feb 5, 2024
commit 3f44b16c8342f08b8aa23b410da72a86ea75de00
8 changes: 6 additions & 2 deletions python/paddle/tensor/creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,14 @@ def _complex_to_real_dtype(dtype):


def _real_to_complex_dtype(dtype):
if dtype == paddle.float32:
if dtype == core.VarDesc.VarType.FP32:
return core.VarDesc.VarType.COMPLEX64
elif dtype == paddle.float64:
elif dtype == core.VarDesc.VarType.FP64:
return core.VarDesc.VarType.COMPLEX128
elif dtype == paddle.pir.core.DataType.FP32:
return paddle.pir.core.DataType.COMPLEX64
elif dtype == paddle.pir.core.DataType.FP64:
return paddle.pir.core.DataType.COMPLEX128
else:
return dtype

Expand Down