|
304 | 304 |
|
305 | 305 | @noinline function conj(
|
306 | 306 | x::TracedRArray{T,N}; location=mlir_stacktrace("conj", @__FILE__, @__LINE__)
|
307 |
| -) where {T<:Complex,N} |
| 307 | +) where {T,N} |
308 | 308 | res = MLIR.IR.result(
|
309 | 309 | chlo.conj(x.mlir_data; result=mlir_type(TracedRArray{T,N}, size(x)), location)
|
310 | 310 | )
|
|
313 | 313 |
|
314 | 314 | @noinline function conj(
|
315 | 315 | x::TracedRNumber{T}; location=mlir_stacktrace("conj", @__FILE__, @__LINE__)
|
316 |
| -) where {T<:Complex} |
| 316 | +) where {T} |
317 | 317 | res = MLIR.IR.result(
|
318 | 318 | chlo.conj(x.mlir_data; result=mlir_type(TracedRArray{T,0}, ()), location)
|
319 | 319 | )
|
@@ -597,39 +597,47 @@ end
|
597 | 597 | end
|
598 | 598 |
|
599 | 599 | @noinline function real(
|
600 |
| - x::TracedRArray{Complex{T},N}; location=mlir_stacktrace("real", @__FILE__, @__LINE__) |
| 600 | + x::TracedRArray{T,N}; location=mlir_stacktrace("real", @__FILE__, @__LINE__) |
601 | 601 | ) where {T,N}
|
602 | 602 | res = MLIR.IR.result(
|
603 |
| - stablehlo.real(x.mlir_data; result=mlir_type(TracedRArray{T,N}, size(x)), location) |
| 603 | + stablehlo.real( |
| 604 | + x.mlir_data; result=mlir_type(TracedRArray{Base.real(T),N}, size(x)), location |
| 605 | + ), |
604 | 606 | )
|
605 |
| - return TracedRArray{T,N}((), res, size(x)) |
| 607 | + return TracedRArray{Base.real(T),N}((), res, size(x)) |
606 | 608 | end
|
607 | 609 |
|
608 | 610 | @noinline function real(
|
609 |
| - x::TracedRNumber{Complex{T}}; location=mlir_stacktrace("real", @__FILE__, @__LINE__) |
| 611 | + x::TracedRNumber{T}; location=mlir_stacktrace("real", @__FILE__, @__LINE__) |
610 | 612 | ) where {T}
|
611 | 613 | res = MLIR.IR.result(
|
612 |
| - stablehlo.real(x.mlir_data; result=mlir_type(TracedRArray{T,0}, ()), location) |
| 614 | + stablehlo.real( |
| 615 | + x.mlir_data; result=mlir_type(TracedRArray{Base.real(T),0}, ()), location |
| 616 | + ), |
613 | 617 | )
|
614 |
| - return TracedRNumber{T}((), res) |
| 618 | + return TracedRNumber{Base.real(T)}((), res) |
615 | 619 | end
|
616 | 620 |
|
617 | 621 | @noinline function imag(
|
618 |
| - x::TracedRArray{Complex{T},N}; location=mlir_stacktrace("imag", @__FILE__, @__LINE__) |
| 622 | + x::TracedRArray{T,N}; location=mlir_stacktrace("imag", @__FILE__, @__LINE__) |
619 | 623 | ) where {T,N}
|
620 | 624 | res = MLIR.IR.result(
|
621 |
| - stablehlo.imag(x.mlir_data; result=mlir_type(TracedRArray{T,N}, size(x)), location) |
| 625 | + stablehlo.imag( |
| 626 | + x.mlir_data; result=mlir_type(TracedRArray{Base.real(T),N}, size(x)), location |
| 627 | + ), |
622 | 628 | )
|
623 |
| - return TracedRArray{T,N}((), res, size(x)) |
| 629 | + return TracedRArray{Base.real(T),N}((), res, size(x)) |
624 | 630 | end
|
625 | 631 |
|
626 | 632 | @noinline function imag(
|
627 |
| - x::TracedRNumber{Complex{T}}; location=mlir_stacktrace("imag", @__FILE__, @__LINE__) |
| 633 | + x::TracedRNumber{T}; location=mlir_stacktrace("imag", @__FILE__, @__LINE__) |
628 | 634 | ) where {T}
|
629 | 635 | res = MLIR.IR.result(
|
630 |
| - stablehlo.imag(x.mlir_data; result=mlir_type(TracedRArray{T,0}, ()), location) |
| 636 | + stablehlo.imag( |
| 637 | + x.mlir_data; result=mlir_type(TracedRArray{Base.real(T),0}, ()), location |
| 638 | + ), |
631 | 639 | )
|
632 |
| - return TracedRNumber{T}((), res) |
| 640 | + return TracedRNumber{Base.real(T)}((), res) |
633 | 641 | end
|
634 | 642 |
|
635 | 643 | function bitcast_convert(
|
|
679 | 687 | end
|
680 | 688 | elseif type == "IRFFT"
|
681 | 689 | @assert T <: Complex
|
682 |
| - Tout = Base.real(T) |
| 690 | + Tout = Base.Base.real(T) |
683 | 691 | rsize = let rsize = collect(Int64, size(x))
|
684 | 692 | rsize[(end - Base.length(length) + 1):end] = length
|
685 | 693 | Tuple(rsize)
|
|
0 commit comments