diff --git a/python/oneflow/test_utils/automated_test_util/torch_flow_dual_object.py b/python/oneflow/test_utils/automated_test_util/torch_flow_dual_object.py index 80c6341fa84..9ba78e523f5 100644 --- a/python/oneflow/test_utils/automated_test_util/torch_flow_dual_object.py +++ b/python/oneflow/test_utils/automated_test_util/torch_flow_dual_object.py @@ -1405,9 +1405,9 @@ def random_tensor( ): if isinstance(requires_grad, generator): requires_grad = requires_grad.value() - # if dtype == float and testing_complex: - # # Generate complex with the probability of 0.5 - # dtype = complex if rng.integers(0, 2) == 1 else float + if dtype == float and testing_complex: + # Generate complex with the probability of 0.5 + dtype = complex if rng.integers(0, 2) == 1 else float pytorch_tensor = ( random_pytorch_tensor(