Conversation
Contributor
|
Your PR requires formatting changes to meet the project's style guidelines. Click here to view the suggested changes.diff --git a/ext/ExaModelsMOI.jl b/ext/ExaModelsMOI.jl
index 64b3f7e..29bc7bb 100644
--- a/ext/ExaModelsMOI.jl
+++ b/ext/ExaModelsMOI.jl
@@ -487,7 +487,7 @@ function _exafy(e::MOI.ScalarAffineFunction{T}, var_to_idx, p = ()) where {T}
c1, p = _exafy(term, var_to_idx, p)
c1
end for term in e.terms) +
- ExaModels.DataIndexed(ExaModels.DataSource(), length(p) + 1)
+ ExaModels.DataIndexed(ExaModels.DataSource(), length(p) + 1)
else
ExaModels.DataIndexed(ExaModels.DataSource(), length(p) + 1)
end
diff --git a/src/gradient.jl b/src/gradient.jl
index 39a677e..21fca26 100644
--- a/src/gradient.jl
+++ b/src/gradient.jl
@@ -68,7 +68,7 @@ Performs dsparse gradient evaluation via the reverse pass on the computation (su
o1,
cnt,
adj,
-) where {D<:Union{AdjointNull,DataIndexed,Real}}
+ ) where {D <: Union{AdjointNull, DataIndexed, Real}}
return cnt
end
@inline function grpass(d::D, comp, y, o1, cnt, adj) where {D<:AdjointNode1}
diff --git a/src/graph.jl b/src/graph.jl
index b85df20..ef53e39 100644
--- a/src/graph.jl
+++ b/src/graph.jl
@@ -79,11 +79,11 @@ A parameterized data node
# Fields:
- `inner::I`: parameter for the data
"""
-struct DataIndexed{I,J} <: AbstractNode
+struct DataIndexed{I, J} <: AbstractNode
inner::I
end
-@inline DataIndexed(inner::I, n) where {I} = DataIndexed{I,n}(inner)
+@inline DataIndexed(inner::I, n) where {I} = DataIndexed{I, n}(inner)
"""
Node1{F, I}
@@ -119,7 +119,7 @@ end
@inline Base.getproperty(n::DataSource, s::Symbol) = DataIndexed(n, s)
@inline Base.getindex(n::DataSource, i) = DataIndexed(n, i)
-@inline Base.indexed_iterate(n::P, idx, start = 1) where P <: Union{DataSource, DataIndexed} = (DataIndexed(n, idx), idx + 1)
+@inline Base.indexed_iterate(n::P, idx, start = 1) where {P <: Union{DataSource, DataIndexed}} = (DataIndexed(n, idx), idx + 1)
@inline Base.getproperty(v::DataIndexed{I, n}, s::Symbol) where {I, n} = DataIndexed(v, s)
@inline Base.getindex(v::DataIndexed{I, n}, i) where {I, n} = DataIndexed(v, i)
@@ -148,7 +148,7 @@ struct Identity end
@inline (v::ParameterNode{I})(::Identity, x, ::Nothing) where {I<:AbstractNode} = NaN
@inline (v::DataSource)(i, x, θ) = i
-@inline (v::DataIndexed{I,n})(i, x, θ) where {I,n} = @inbounds getfield(getfield(v, :inner)(i, x, θ), n)
+@inline (v::DataIndexed{I, n})(i, x, θ) where {I, n} = @inbounds getfield(getfield(v, :inner)(i, x, θ), n)
(v::DataIndexed)(i::Identity, x, θ) = NaN # despecialized
(v::DataSource)(i::Identity, x, θ) = NaN # despecialized |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR changes
PartoDatato avoid naming conflicts withParameter