'Sets shape based parameters of this layer given an input tuple or int
or input layer.
Arguments:
in_obj (int, tuple, Layer or Tensor): object that provides shape
information for layer
Returns:
(tuple): shape of output data'

def configure(self, in_obj):

    super(Pooling, self).configure(in_obj)
    if (self.nglayer is None):
        assert isinstance(self.in_shape, tuple)
        ikeys = (('C', 'H', 'W') if (len(self.in_shape) == 3) else ('C', 'D', 'H', 'W'))
        shapedict = {k: x for (k, x) in zip(ikeys, self.in_shape)}
        shapedict['N'] = self.be.bsz
        self.poolparams.update(shapedict)
        if (self.poolparams['R'] is None):
            self.poolparams['R'] = shapedict['H']
            self.poolparams['S'] = shapedict['W']
        self.nglayer = self.be.pool_layer(self.be.default_dtype, **self.poolparams)
        (K, M, P, Q, N) = self.nglayer.dimO
        self.out_shape = ((K, M, P, Q) if (len(self.in_shape) == 4) else (K, P, Q))
    return self
