Skip to content

Commit a0ccad5

Browse files
committed
define ProjectTo
1 parent 3d2c066 commit a0ccad5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/ReliabilityOptimization.jl

+8
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,12 @@ function (f::RandomFunction)(x)
101101
return MvNormal(muf, covf)
102102
end
103103

104+
function ChainRulesCore.ProjectTo(x::StaticArraysCore.SVector{N, Vector{Float64}}) where {N}
105+
return ChainRulesCore.ProjectTo{SArray}(;
106+
element = ChainRulesCore.ProjectTo(zero(first(x))),
107+
axes = axes(x),
108+
size = Size(x),
109+
)
110+
end
111+
104112
end

0 commit comments

Comments
 (0)