Skip to content

mindspore.ops.isreal fails on empty complex tensor while paddle.isreal succeeds (CPU) #365

Description

@tingPetty

For empty complex input (shape (1, 0, 4)), paddle.isreal succeeds but mindspore.ops.isreal fails. Internally MindSpore reports Imag kernel init failure and CreateKernel RuntimeError.

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.isreal fails on complex64 input shape (1, 0, 4). Logs indicate underlying Imag CPU kernel rejects empty input/output.

Describe the expected behavior

isreal should work for empty complex tensors and return empty boolean tensor, or fail with clear API-level validation message instead of internal kernel creation failure.

Steps to reproduce the issue

  1. Run pd_ms_test_1/simple_tests/ms_error_only_candidate_179_isreal.py.
  2. Observe [PD] success and [OTHER] error.
  3. Error output contains For 'Imag', it got empty inputs or outputs, which is invalid.

Related log / screenshot

[ERROR] ... For 'Imag', 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions