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