@@ -9,7 +9,7 @@ struct FixedSizeDiffCache{T <: AbstractArray, S <: AbstractArray}
99end
1010
1111function FixedSizeDiffCache (u:: AbstractArray{T} , siz,
12- :: Type{Val{chunk_size}} ) where {T, chunk_size}
12+ :: Type{Val{chunk_size}} ) where {T, chunk_size}
1313 x = ArrayInterface. restructure (u,
1414 zeros (ForwardDiff. Dual{nothing , T, chunk_size},
1515 siz... ))
@@ -25,8 +25,8 @@ and for the `Dual` version of `u`, allowing use of pre-cached vectors with
2525forward-mode automatic differentiation.
2626"""
2727function FixedSizeDiffCache (u:: AbstractArray ,
28- :: Type{Val{N}} = Val{ForwardDiff. pickchunksize (length (u))}) where {
29- N,
28+ :: Type{Val{N}} = Val{ForwardDiff. pickchunksize (length (u))}) where {
29+ N,
3030}
3131 FixedSizeDiffCache (u, size (u), Val{N})
3232end
@@ -75,7 +75,7 @@ function get_tmp(dc::FixedSizeDiffCache, u::Union{Number, AbstractArray})
7575 end
7676end
7777
78- function get_tmp (dc:: FixedSizeDiffCache , :: Type{T} ) where T <: Number
78+ function get_tmp (dc:: FixedSizeDiffCache , :: Type{T} ) where { T <: Number }
7979 if promote_type (eltype (dc. du), T) <: eltype (dc. du)
8080 dc. du
8181 else
@@ -111,7 +111,7 @@ forward-mode automatic differentiation. Supports nested AD via keyword `levels`
111111or specifying an array of chunk_sizes.
112112"""
113113function DiffCache (u:: AbstractArray , N:: Int = ForwardDiff. pickchunksize (length (u));
114- levels:: Int = 1 )
114+ levels:: Int = 1 )
115115 DiffCache (u, size (u), N * ones (Int, levels))
116116end
117117DiffCache (u:: AbstractArray , N:: AbstractArray{<:Int} ) = DiffCache (u, size (u), N)
@@ -164,7 +164,7 @@ function get_tmp(dc::DiffCache, u::Union{Number, AbstractArray})
164164 end
165165end
166166
167- function get_tmp (dc:: DiffCache , :: Type{T} ) where T <: Number
167+ function get_tmp (dc:: DiffCache , :: Type{T} ) where { T <: Number }
168168 if promote_type (eltype (dc. du), T) <: eltype (dc. du)
169169 dc. du
170170 else
0 commit comments