Skip to content

Commit

Permalink
fix ci nn 5
Browse files Browse the repository at this point in the history
  • Loading branch information
glou-nes committed Jan 31, 2025
1 parent 379debc commit 08e800e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ext/ReactantNNlibExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,10 @@ function reduce_window(f, x::AnyTracedRArray{T,N}, pdims; init) where {T,N}
body
end

attr = fill(Reactant.MLIR.IR.Attribute(init), unranked)
init_value = Reactant.MLIR.IR.result(Ops.constant(; value=attr))
attr = Reactant.MLIR.IR.DenseElements(fill(Reactant.MLIR.IR.Attribute(init), unranked))
init_value = Reactant.MLIR.IR.result(
Reactant.MLIR.Dialects.stablehlo.constant(; value=attr)
)
reduction = Reactant.MLIR.Dialects.stablehlo.reduce_window(
[get_mlir_data(x)],
[init_value];
Expand Down
1 change: 1 addition & 0 deletions src/mlir/IR/Attribute.jl
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,7 @@ Base.show(io::IO, f::FlatSymbol) = print(io, "@$(flatsymbol(f.attr))")
struct DenseElements{T}
attr::Attribute
DenseElements(a::AbstractArray{T}) where {T} = new{T}(IR.DenseElementsAttribute(a))
DenseElements(a::Attribute) = begin if !isdenseelements(a) throw("$a is not a dense elements attribute.") end; new{:Generic}(a) end
end
Attribute(d::DenseElements) = d.attr

Expand Down

0 comments on commit 08e800e

Please sign in to comment.