When input is an empty complex tensor with shape (10, 0), paddle.as_real succeeds but mindspore.ops.real fails with CPU kernel CreateKernel RuntimeError. This looks like a robustness issue in empty-tensor handling.
Environment
Hardware Environment(Ascend/GPU/CPU):
/device cpu
Software Environment:
- MindSpore version (source or binary): 2.8.0 (binary)
- Python version (e.g., Python 3.7.5): 3.10.18
- OS platform and distribution (e.g., Linux Ubuntu 16.04): Windows 10 (10.0.26200)
- GCC/Compiler version (if compiled from source): N/A
Describe the current behavior
mindspore.ops.real on complex128 tensor with shape (10, 0) fails with RuntimeError and C++ CreateKernel stack. Paddle reference succeeds.
Describe the expected behavior
mindspore.ops.real should support empty complex tensors and return an empty real tensor, or at least raise a clear user-facing validation error instead of internal kernel creation failure.
Steps to reproduce the issue
- Run
pd_ms_test_1/simple_tests/ms_error_only_candidate_053_as_real.py.
- Observe
[PD] success and [OTHER] error.
- Error includes
UnaryOpCpuKernelMod::Init and CPUKernelExecutor::CreateKernel.
Related log / screenshot
[ERROR] ... For 'Real', it got empty inputs or outputs, which is invalid.
RuntimeError:
- C++ Call Stack:
mindspore\ccsrc\plugin\cpu\cpu_device_context.cc:543 mindspore::device::cpu::CPUKernelExecutor::CreateKernel
Special notes for this issue
- Paddle version in repro: 3.2.0
When input is an empty complex tensor with shape
(10, 0),paddle.as_realsucceeds butmindspore.ops.realfails with CPU kernel CreateKernel RuntimeError. This looks like a robustness issue in empty-tensor handling.Environment
Hardware Environment(
Ascend/GPU/CPU):/device cpu
Software Environment:
Describe the current behavior
mindspore.ops.realoncomplex128tensor with shape(10, 0)fails with RuntimeError and C++ CreateKernel stack. Paddle reference succeeds.Describe the expected behavior
mindspore.ops.realshould support empty complex tensors and return an empty real tensor, or at least raise a clear user-facing validation error instead of internal kernel creation failure.Steps to reproduce the issue
pd_ms_test_1/simple_tests/ms_error_only_candidate_053_as_real.py.[PD] successand[OTHER] error.UnaryOpCpuKernelMod::InitandCPUKernelExecutor::CreateKernel.Related log / screenshot
Special notes for this issue