maxPool

fun maxPool(x: DTensor, poolHeight: Int, poolWidth: Int): DTensor

Returns the max of the pool (poolHeight x poolWidth) for each pool in x with a stride of (poolHeight, poolWidth). Requires that dim H on x be divisible by poolHeight and dim W on x be divisible by poolWidth

Parameters

x

: a tensor of rank 4 and shape NHWC

Example:

val t = FloatTensor(Shape(1, 4, 4, 1), floatArrayOf(1f, 2f, 3f, ..., 16f) MaxPool.maxPool(t, 2, 2)

FloatTensor(Shape(1, 2, 2, 1), floatArrayOf(6f, 8f, 14f, 16f))