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

def AddDropout(self, prev_layer, index):

    pattern = re.compile('(Do)({\\w+})?')
    m = pattern.match(self.model_str, index)
    if (m is None):
        return (None, None)
    name = self._GetLayerName(m.group(0), index, m.group(2))
    layer = slim.dropout(prev_layer, 0.5, is_training=self.is_training, scope=name)
    return (layer, m.end())
