Skip to content

Commit

Permalink
remove view (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
prbzrg authored Feb 27, 2024
1 parent 40a1a8a commit 15681e2
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 69 deletions.
12 changes: 6 additions & 6 deletions src/base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ end
Array
end

@views function inference_sol(
function inference_sol(
icnf::AbstractFlows{T, <:VectorMode, INPLACE},
mode::Mode,
prob::SciMLBase.AbstractODEProblem{<:AbstractVector{<:Real}, NTuple{2, T}, INPLACE},
Expand All @@ -168,7 +168,7 @@ end
(logp̂x, augs)
end

@views function inference_sol(
function inference_sol(
icnf::AbstractFlows{T, <:MatrixMode, INPLACE},
mode::Mode,
prob::SciMLBase.AbstractODEProblem{<:AbstractMatrix{<:Real}, NTuple{2, T}, INPLACE},
Expand All @@ -183,7 +183,7 @@ end
(logp̂x, eachrow(augs))
end

@views function generate_sol(
function generate_sol(
icnf::AbstractFlows{T, <:VectorMode, INPLACE},
mode::Mode,
prob::SciMLBase.AbstractODEProblem{<:AbstractVector{<:Real}, NTuple{2, T}, INPLACE},
Expand All @@ -196,7 +196,7 @@ end
z
end

@views function generate_sol(
function generate_sol(
icnf::AbstractFlows{T, <:MatrixMode, INPLACE},
mode::Mode,
prob::SciMLBase.AbstractODEProblem{<:AbstractMatrix{<:Real}, NTuple{2, T}, INPLACE},
Expand All @@ -209,10 +209,10 @@ end
z
end

@inline @views function get_fsol(sol::SciMLBase.AbstractODESolution)
@inline function get_fsol(sol::SciMLBase.AbstractODESolution)
last(sol.u)
end

@inline @views function get_fsol(sol::AbstractArray{T, N}) where {T, N}
@inline function get_fsol(sol::AbstractArray{T, N}) where {T, N}
selectdim(sol, N, lastindex(sol, N))
end
8 changes: 4 additions & 4 deletions src/base_cond_icnf.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export inference, generate, loss

@views function inference_prob(
function inference_prob(
icnf::AbstractCondICNF{T, <:VectorMode, INPLACE},
mode::Mode,
xs::AbstractVector{<:Real},
Expand Down Expand Up @@ -30,7 +30,7 @@ export inference, generate, loss
)
end

@views function inference_prob(
function inference_prob(
icnf::AbstractCondICNF{T, <:MatrixMode, INPLACE},
mode::Mode,
xs::AbstractMatrix{<:Real},
Expand Down Expand Up @@ -60,7 +60,7 @@ end
)
end

@views function generate_prob(
function generate_prob(
icnf::AbstractCondICNF{T, <:VectorMode, INPLACE},
mode::Mode,
ys::AbstractVector{<:Real},
Expand Down Expand Up @@ -91,7 +91,7 @@ end
)
end

@views function generate_prob(
function generate_prob(
icnf::AbstractCondICNF{T, <:MatrixMode, INPLACE},
mode::Mode,
ys::AbstractMatrix{<:Real},
Expand Down
8 changes: 4 additions & 4 deletions src/base_icnf.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export inference, generate, loss

@views function inference_prob(
function inference_prob(
icnf::AbstractICNF{T, <:VectorMode, INPLACE},
mode::Mode,
xs::AbstractVector{<:Real},
Expand Down Expand Up @@ -29,7 +29,7 @@ export inference, generate, loss
)
end

@views function inference_prob(
function inference_prob(
icnf::AbstractICNF{T, <:MatrixMode, INPLACE},
mode::Mode,
xs::AbstractMatrix{<:Real},
Expand Down Expand Up @@ -58,7 +58,7 @@ end
)
end

@views function generate_prob(
function generate_prob(
icnf::AbstractICNF{T, <:VectorMode, INPLACE},
mode::Mode,
ps::Any,
Expand Down Expand Up @@ -88,7 +88,7 @@ end
)
end

@views function generate_prob(
function generate_prob(
icnf::AbstractICNF{T, <:MatrixMode, INPLACE},
mode::Mode,
ps::Any,
Expand Down
36 changes: 18 additions & 18 deletions src/cond_ffjord.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct CondRNODE{
λ₂::T
end

@views function augmented_f(
function augmented_f(
u::Any,
p::Any,
t::Any,
Expand All @@ -99,7 +99,7 @@ end
vcat(ż, l̇)
end

@views function augmented_f(
function augmented_f(
du::Any,
u::Any,
p::Any,
Expand All @@ -124,7 +124,7 @@ end
nothing
end

@views function augmented_f(
function augmented_f(
u::Any,
p::Any,
t::Any,
Expand All @@ -143,7 +143,7 @@ end
vcat(ż, l̇)
end

@views function augmented_f(
function augmented_f(
du::Any,
u::Any,
p::Any,
Expand All @@ -164,7 +164,7 @@ end
nothing
end

@views function augmented_f(
function augmented_f(
u::Any,
p::Any,
t::Any,
Expand All @@ -183,7 +183,7 @@ end
vcat(ż, l̇)
end

@views function augmented_f(
function augmented_f(
du::Any,
u::Any,
p::Any,
Expand All @@ -204,7 +204,7 @@ end
nothing
end

@views function augmented_f(
function augmented_f(
u::Any,
p::Any,
t::Any,
Expand Down Expand Up @@ -234,7 +234,7 @@ end
end
end

@views function augmented_f(
function augmented_f(
du::Any,
u::Any,
p::Any,
Expand Down Expand Up @@ -264,7 +264,7 @@ end
nothing
end

@views function augmented_f(
function augmented_f(
u::Any,
p::Any,
t::Any,
Expand Down Expand Up @@ -295,7 +295,7 @@ end
end
end

@views function augmented_f(
function augmented_f(
du::Any,
u::Any,
p::Any,
Expand Down Expand Up @@ -326,7 +326,7 @@ end
nothing
end

@views function augmented_f(
function augmented_f(
u::Any,
p::Any,
t::Any,
Expand All @@ -352,7 +352,7 @@ end
end
end

@views function augmented_f(
function augmented_f(
du::Any,
u::Any,
p::Any,
Expand All @@ -378,7 +378,7 @@ end
nothing
end

@views function augmented_f(
function augmented_f(
u::Any,
p::Any,
t::Any,
Expand Down Expand Up @@ -409,7 +409,7 @@ end
end
end

@views function augmented_f(
function augmented_f(
du::Any,
u::Any,
p::Any,
Expand Down Expand Up @@ -440,7 +440,7 @@ end
nothing
end

@views function augmented_f(
function augmented_f(
u::Any,
p::Any,
t::Any,
Expand Down Expand Up @@ -471,7 +471,7 @@ end
end
end

@views function augmented_f(
function augmented_f(
du::Any,
u::Any,
p::Any,
Expand Down Expand Up @@ -502,7 +502,7 @@ end
nothing
end

@views function augmented_f(
function augmented_f(
u::Any,
p::Any,
t::Any,
Expand All @@ -528,7 +528,7 @@ end
end
end

@views function augmented_f(
function augmented_f(
du::Any,
u::Any,
p::Any,
Expand Down
16 changes: 8 additions & 8 deletions src/cond_planar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct CondPlanar{
rng::RNG
end

@views function augmented_f(
function augmented_f(
u::Any,
p::Any,
t::Any,
Expand Down Expand Up @@ -65,7 +65,7 @@ end
vcat(ż, l̇)
end

@views function augmented_f(
function augmented_f(
du::Any,
u::Any,
p::Any,
Expand Down Expand Up @@ -96,7 +96,7 @@ end
nothing
end

@views function augmented_f(
function augmented_f(
u::Any,
p::Any,
t::Any,
Expand Down Expand Up @@ -125,7 +125,7 @@ end
vcat(ż, l̇)
end

@views function augmented_f(
function augmented_f(
du::Any,
u::Any,
p::Any,
Expand Down Expand Up @@ -156,7 +156,7 @@ end
nothing
end

@views function augmented_f(
function augmented_f(
u::Any,
p::Any,
t::Any,
Expand All @@ -179,7 +179,7 @@ end
vcat(ż, l̇)
end

@views function augmented_f(
function augmented_f(
du::Any,
u::Any,
p::Any,
Expand All @@ -204,7 +204,7 @@ end
nothing
end

@views function augmented_f(
function augmented_f(
u::Any,
p::Any,
t::Any,
Expand All @@ -227,7 +227,7 @@ end
vcat(ż, l̇)
end

@views function augmented_f(
function augmented_f(
du::Any,
u::Any,
p::Any,
Expand Down
Loading

0 comments on commit 15681e2

Please sign in to comment.