Skip to content

Commit

Permalink
remove all type piracy
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed82008 committed Feb 2, 2024
1 parent 0ad5070 commit 3d2c066
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/ReliabilityOptimization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,4 @@ function (f::RandomFunction)(x)
return MvNormal(muf, covf)
end

# necessary type piracy FiniteDifferences._estimate_magnitudes uses this constructor which Zygote struggles to differentiate on its own
function ChainRulesCore.rrule(
::typeof(StaticArraysCore.SVector{3}),
x1::T,
x2::T,
x3::T,
) where {T}
StaticArraysCore.SVector{3}(x1, x2, x3), Δ -> (NoTangent(), Δ[1], Δ[2], Δ[3])
end

function ChainRulesCore._eltype_projectto(::Type{T}) where {T<:AbstractVector{<:Number}}
return ChainRulesCore.ProjectTo(zero(T))
end

end

0 comments on commit 3d2c066

Please sign in to comment.