'Add a maxpool layer.
Args:
prev_layer: Input tensor.
index:      Position in model_str to start parsing
Returns:
Output tensor, end index in model_str.'

def AddMaxPool(self, prev_layer, index):

    pattern = re.compile('(Mp)({\\w+})?(\\d+),(\\d+)(?:,(\\d+),(\\d+))?')
    m = pattern.match(self.model_str, index)
    if (m is None):
        return (None, None)
    name = self._GetLayerName(m.group(0), index, m.group(2))
    height = int(m.group(3))
    width = int(m.group(4))
    y_stride = (height if (m.group(5) is None) else m.group(5))
    x_stride = (width if (m.group(6) is None) else m.group(6))
    self.reduction_factors[1] *= y_stride
    self.reduction_factors[2] *= x_stride
    return (slim.max_pool2d(prev_layer, [height, width], [y_stride, x_stride], padding='SAME', scope=name), m.end())
