From d745078038b6d333179e4bf2d004f150714e6c26 Mon Sep 17 00:00:00 2001 From: Chad Scherrer Date: Fri, 4 Aug 2023 15:21:55 -0700 Subject: [PATCH] Replace `Vararg{<:` with `Vararg{` --- src/combinators/power.jl | 10 +++++----- src/combinators/smart-constructors.jl | 2 +- src/static.jl | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/combinators/power.jl b/src/combinators/power.jl index 76cd4859..a7fa24f8 100644 --- a/src/combinators/power.jl +++ b/src/combinators/power.jl @@ -29,7 +29,7 @@ end # ToDo: Make rand return static arrays for statically-sized power measures. -function _cartidxs(axs::Tuple{Vararg{<:AbstractUnitRange,N}}) where {N} +function _cartidxs(axs::Tuple{Vararg{AbstractUnitRange,N}}) where {N} CartesianIndices(map(_dynamic, axs)) end @@ -49,16 +49,16 @@ function Base.rand(rng::AbstractRNG, ::Type{T}, d::PowerMeasure) where {T} end end -@inline _pm_axes(sz::Tuple{Vararg{<:IntegerLike,N}}) where {N} = map(one_to, sz) -@inline _pm_axes(axs::Tuple{Vararg{<:AbstractUnitRange,N}}) where {N} = axs +@inline _pm_axes(sz::Tuple{Vararg{IntegerLike,N}}) where {N} = map(one_to, sz) +@inline _pm_axes(axs::Tuple{Vararg{AbstractUnitRange,N}}) where {N} = axs -@inline function powermeasure(x::T, sz::Tuple{Vararg{<:Any,N}}) where {T,N} +@inline function powermeasure(x::T, sz::Tuple{Vararg{Any,N}}) where {T,N} PowerMeasure(x, _pm_axes(sz)) end marginals(d::PowerMeasure) = fill_with(d.parent, d.axes) -function Base.:^(μ::AbstractMeasure, dims::Tuple{Vararg{<:AbstractArray,N}}) where {N} +function Base.:^(μ::AbstractMeasure, dims::Tuple{Vararg{AbstractArray,N}}) where {N} powermeasure(μ, dims) end diff --git a/src/combinators/smart-constructors.jl b/src/combinators/smart-constructors.jl index 4d12a1f4..45b1c5fa 100644 --- a/src/combinators/smart-constructors.jl +++ b/src/combinators/smart-constructors.jl @@ -11,7 +11,7 @@ powermeasure(m::AbstractMeasure, ::Tuple{}) = m function powermeasure( μ::WeightedMeasure, - dims::Tuple{<:AbstractArray,Vararg{<:AbstractArray}}, + dims::Tuple{<:AbstractArray,Vararg{AbstractArray}}, ) k = mapreduce(length, *, dims) * μ.logweight return weightedmeasure(k, μ.base^dims) diff --git a/src/static.jl b/src/static.jl index 8ec313fb..da471b62 100644 --- a/src/static.jl +++ b/src/static.jl @@ -29,11 +29,11 @@ Returns an instance of `FillArrays.Fill`. """ function fill_with end -@inline function fill_with(x::T, sz::Tuple{Vararg{<:IntegerLike,N}}) where {T,N} +@inline function fill_with(x::T, sz::Tuple{Vararg{IntegerLike,N}}) where {T,N} fill_with(x, map(one_to, sz)) end -@inline function fill_with(x::T, axs::Tuple{Vararg{<:AbstractUnitRange,N}}) where {T,N} +@inline function fill_with(x::T, axs::Tuple{Vararg{AbstractUnitRange,N}}) where {T,N} # While `FillArrays.Fill` (mostly?) works with axes that are static unit # ranges, some operations that automatic differentiation requires do fail # on such instances of `Fill` (e.g. `reshape` from dynamic to static size).