@@ -17,6 +17,8 @@ import _Differentiation
17
17
/// A max pooling layer for temporal data.
18
18
@frozen
19
19
public struct MaxPool1D < Scalar: TensorFlowFloatingPoint > : ParameterlessLayer {
20
+ public typealias TangentVector = EmptyTangentVector
21
+
20
22
/// The size of the sliding reduction window for pooling.
21
23
@noDerivative public let poolSize : Int
22
24
/// The stride of the sliding window for temporal dimension.
@@ -56,6 +58,8 @@ public struct MaxPool1D<Scalar: TensorFlowFloatingPoint>: ParameterlessLayer {
56
58
/// A max pooling layer for spatial data.
57
59
@frozen
58
60
public struct MaxPool2D < Scalar: TensorFlowFloatingPoint > : ParameterlessLayer {
61
+ public typealias TangentVector = EmptyTangentVector
62
+
59
63
/// The size of the sliding reduction window for pooling.
60
64
@noDerivative public let poolSize : ( Int , Int , Int , Int )
61
65
/// The strides of the sliding window for each dimension of a 4-D input.
@@ -105,6 +109,8 @@ extension MaxPool2D {
105
109
/// A max pooling layer for spatial or spatio-temporal data.
106
110
@frozen
107
111
public struct MaxPool3D < Scalar: TensorFlowFloatingPoint > : ParameterlessLayer {
112
+ public typealias TangentVector = EmptyTangentVector
113
+
108
114
/// The size of the sliding reduction window for pooling.
109
115
@noDerivative public let poolSize : ( Int , Int , Int , Int , Int )
110
116
/// The strides of the sliding window for each dimension of a 5-D input.
@@ -171,6 +177,8 @@ extension MaxPool3D {
171
177
/// An average pooling layer for temporal data.
172
178
@frozen
173
179
public struct AvgPool1D < Scalar: TensorFlowFloatingPoint > : ParameterlessLayer {
180
+ public typealias TangentVector = EmptyTangentVector
181
+
174
182
/// The size of the sliding reduction window for pooling.
175
183
@noDerivative public let poolSize : Int
176
184
/// The stride of the sliding window for temporal dimension.
@@ -210,6 +218,8 @@ public struct AvgPool1D<Scalar: TensorFlowFloatingPoint>: ParameterlessLayer {
210
218
/// An average pooling layer for spatial data.
211
219
@frozen
212
220
public struct AvgPool2D < Scalar: TensorFlowFloatingPoint > : ParameterlessLayer {
221
+ public typealias TangentVector = EmptyTangentVector
222
+
213
223
/// The size of the sliding reduction window for pooling.
214
224
@noDerivative public let poolSize : ( Int , Int , Int , Int )
215
225
/// The strides of the sliding window for each dimension of a 4-D input.
@@ -259,6 +269,8 @@ extension AvgPool2D {
259
269
/// An average pooling layer for spatial or spatio-temporal data.
260
270
@frozen
261
271
public struct AvgPool3D < Scalar: TensorFlowFloatingPoint > : ParameterlessLayer {
272
+ public typealias TangentVector = EmptyTangentVector
273
+
262
274
/// The size of the sliding reduction window for pooling.
263
275
@noDerivative public let poolSize : ( Int , Int , Int , Int , Int )
264
276
/// The strides of the sliding window for each dimension of a 5-D input.
@@ -325,6 +337,8 @@ extension AvgPool3D {
325
337
/// A global average pooling layer for temporal data.
326
338
@frozen
327
339
public struct GlobalAvgPool1D < Scalar: TensorFlowFloatingPoint > : ParameterlessLayer {
340
+ public typealias TangentVector = EmptyTangentVector
341
+
328
342
/// Creates a global average pooling layer.
329
343
public init ( ) { }
330
344
@@ -342,6 +356,8 @@ public struct GlobalAvgPool1D<Scalar: TensorFlowFloatingPoint>: ParameterlessLay
342
356
/// A global average pooling layer for spatial data.
343
357
@frozen
344
358
public struct GlobalAvgPool2D < Scalar: TensorFlowFloatingPoint > : ParameterlessLayer {
359
+ public typealias TangentVector = EmptyTangentVector
360
+
345
361
/// Creates a global average pooling layer.
346
362
public init ( ) { }
347
363
@@ -359,6 +375,8 @@ public struct GlobalAvgPool2D<Scalar: TensorFlowFloatingPoint>: ParameterlessLay
359
375
/// A global average pooling layer for spatial and spatio-temporal data.
360
376
@frozen
361
377
public struct GlobalAvgPool3D < Scalar: TensorFlowFloatingPoint > : ParameterlessLayer {
378
+ public typealias TangentVector = EmptyTangentVector
379
+
362
380
/// Creates a global average pooling layer.
363
381
public init ( ) { }
364
382
@@ -376,6 +394,8 @@ public struct GlobalAvgPool3D<Scalar: TensorFlowFloatingPoint>: ParameterlessLay
376
394
/// A global max pooling layer for temporal data.
377
395
@frozen
378
396
public struct GlobalMaxPool1D < Scalar: TensorFlowFloatingPoint > : ParameterlessLayer {
397
+ public typealias TangentVector = EmptyTangentVector
398
+
379
399
/// Creates a global max pooling layer.
380
400
public init ( ) { }
381
401
@@ -396,6 +416,8 @@ public struct GlobalMaxPool1D<Scalar: TensorFlowFloatingPoint>: ParameterlessLay
396
416
/// A global max pooling layer for spatial data.
397
417
@frozen
398
418
public struct GlobalMaxPool2D < Scalar: TensorFlowFloatingPoint > : ParameterlessLayer {
419
+ public typealias TangentVector = EmptyTangentVector
420
+
399
421
/// Creates a global max pooling layer.
400
422
public init ( ) { }
401
423
@@ -413,6 +435,8 @@ public struct GlobalMaxPool2D<Scalar: TensorFlowFloatingPoint>: ParameterlessLay
413
435
/// A global max pooling layer for spatial and spatio-temporal data.
414
436
@frozen
415
437
public struct GlobalMaxPool3D < Scalar: TensorFlowFloatingPoint > : ParameterlessLayer {
438
+ public typealias TangentVector = EmptyTangentVector
439
+
416
440
/// Creates a global max pooling layer.
417
441
public init ( ) { }
418
442
@@ -431,6 +455,8 @@ public struct GlobalMaxPool3D<Scalar: TensorFlowFloatingPoint>: ParameterlessLay
431
455
/// Note: `FractionalMaxPool` does not have an XLA implementation, and thus may have performance implications.
432
456
@frozen
433
457
public struct FractionalMaxPool2D < Scalar: TensorFlowFloatingPoint > : ParameterlessLayer {
458
+ public typealias TangentVector = EmptyTangentVector
459
+
434
460
/// Pooling ratios for each dimension of input of shape (batch, height, width, channels).
435
461
/// Currently pooling in only height and width is supported.
436
462
@noDerivative public let poolingRatio : ( Double , Double , Double , Double )
0 commit comments