@@ -142,8 +142,13 @@ This constructor does not store/modify `y` or `x`.
142
142
x:: X ;
143
143
tag:: Union{Symbol,Nothing} = :default ) where {F,X<: Real ,Y<: Real }
144
144
# @inline ensures that, e.g., DerivativeConfig(...; tag = :small) will be well-inferred
145
- T = @inline maketag (tag, f, X)
146
- return @noinline DerivativeConfig (f,y,x,T)
145
+ @static if VERSION ≥ v " 1.8"
146
+ T = @inline maketag (tag, f, X)
147
+ return @noinline DerivativeConfig (f,y,x,T)
148
+ else
149
+ T = maketag (tag, f, X)
150
+ return DerivativeConfig (f,y,x,T)
151
+ end
147
152
end
148
153
149
154
function DerivativeConfig (f:: F ,
@@ -189,8 +194,13 @@ This constructor does not store/modify `x`.
189
194
c:: Chunk{N} = Chunk (x);
190
195
tag:: Union{Symbol,Nothing} = :default ) where {F,V,N}
191
196
# @inline ensures that, e.g., GradientConfig(...; tag = :small) will be well-inferred
192
- T = @inline maketag (tag, f, V)
193
- return @noinline GradientConfig (f,x,c,T)
197
+ @static if VERSION ≥ v " 1.8"
198
+ T = @inline maketag (tag, f, V)
199
+ return @noinline GradientConfig (f,x,c,T)
200
+ else
201
+ T = maketag (tag, f, V)
202
+ return GradientConfig (f,x,c,T)
203
+ end
194
204
end
195
205
196
206
function GradientConfig (f:: F ,
@@ -238,8 +248,13 @@ This constructor does not store/modify `x`.
238
248
c:: Chunk{N} = Chunk (x);
239
249
tag:: Union{Symbol,Nothing} = :default ) where {F,V,N}
240
250
# @inline ensures that, e.g., JacobianConfig(...; tag = :small) will be well-inferred
241
- T = @inline maketag (tag, f, V)
242
- return @noinline JacobianConfig (f,x,c,T)
251
+ @static if VERSION ≥ v " 1.8"
252
+ T = @inline maketag (tag, f, V)
253
+ return @noinline JacobianConfig (f,x,c,T)
254
+ else
255
+ T = maketag (tag, f, V)
256
+ return JacobianConfig (f,x,c,T)
257
+ end
243
258
end
244
259
245
260
function JacobianConfig (f:: F ,
@@ -276,8 +291,13 @@ This constructor does not store/modify `y` or `x`.
276
291
c:: Chunk{N} = Chunk (x);
277
292
tag:: Union{Symbol,Nothing} = :default ) where {F,Y,X,N}
278
293
# @inline ensures that, e.g., JacobianConfig(...; tag = :small) will be well-inferred
279
- T = @inline maketag (tag, f, X)
280
- return @noinline JacobianConfig (f,y,x,c,T)
294
+ @static if VERSION ≥ v " 1.8"
295
+ T = @inline maketag (tag, f, X)
296
+ return @noinline JacobianConfig (f,y,x,c,T)
297
+ else
298
+ T = maketag (tag, f, X)
299
+ return JacobianConfig (f,y,x,c,T)
300
+ end
281
301
end
282
302
283
303
function JacobianConfig (f:: F ,
@@ -330,8 +350,13 @@ This constructor does not store/modify `x`.
330
350
chunk:: Chunk = Chunk (x);
331
351
tag:: Union{Symbol,Nothing} = :default ) where {F,V}
332
352
# @inline ensures that, e.g., HessianConfig(...; tag = :small) will be well-inferred
333
- T = @inline maketag (tag, f, V)
334
- return @noinline HessianConfig (f, x, chunk, T)
353
+ @static if VERSION ≥ v " 1.8"
354
+ T = @inline maketag (tag, f, V)
355
+ return @noinline HessianConfig (f, x, chunk, T)
356
+ else
357
+ T = maketag (tag, f, V)
358
+ return HessianConfig (f, x, chunk, T)
359
+ end
335
360
end
336
361
337
362
function HessianConfig (f:: F ,
@@ -367,8 +392,13 @@ This constructor does not store/modify `x`.
367
392
chunk:: Chunk = Chunk (x);
368
393
tag:: Union{Symbol,Nothing} = :default ) where {F,V}
369
394
# @inline ensures that, e.g., HessianConfig(...; tag = :small) will be well-inferred
370
- T = @inline maketag (tag, f, V)
371
- return @noinline HessianConfig (f, result, x, chunk, T)
395
+ @static if VERSION ≥ v " 1.8"
396
+ T = @inline maketag (tag, f, V)
397
+ return @noinline HessianConfig (f, result, x, chunk, T)
398
+ else
399
+ T = maketag (tag, f, V)
400
+ return HessianConfig (f, result, x, chunk, T)
401
+ end
372
402
end
373
403
374
404
function HessianConfig (f:: F ,
0 commit comments