Skip to content

Ops.cbrt crashes for complex number but spec says it supports them #291

@mofeing

Description

@mofeing

The test is the following:

x = ConcreteRArray([1.0 + 2.0im, 8.0 + 16.0im, 27.0 + 54.0im, 64.0 + 128.0im])
@test Array(x) .^ (1//3)  @jit Ops.cbrt(x)

and yields the following error: https://github.com/EnzymeAD/Reactant.jl/actions/runs/11915696798/job/33206565483?pr=267#step:9:812

terminate called after throwing an instance of 'xla::XlaRuntimeError'
  what():  UNKNOWN: <unknown>:0: error: Expected element type in shape to be floating for cbrt operation; got C128.: 
<unknown>:0: note: see current operation: "func.return"(%0) : (tensor<4xcomplex<f64>>) -> ()

The StableHLO spec says it supports complex numbers
Image

@wsmoses should we raise this to XLA repo?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions