A tensor containing a batch of input feature maps.
An array of pool dims.
An operation representing a max pool computation.
1 import dopt.core : evaluate; 2 3 auto features = float32([1, 1, 4, 4], [ 4 1.0f, 2.0f, 4.0f, 3.0f, 5 5.0f, 3.0f, 2.0f, 2.0f, 6 0.1f, -4.0f, 3.0f, 2.0f, 7 0.0f, 0.0f, 2.0f, 2.0f 8 ]); 9 10 auto result = features.maxpool([2,2]); 11 12 auto pooledFeatures = result.evaluate().as!float; 13 14 assert(pooledFeatures == [ 15 5.0f, 4.0f, 16 0.1f, 3.0f 17 ]);
Creates a max pool operation that performs the computation required to implement a max pooling layer.