'Builds a sequence of layers for a VGSLSpecs model.
Args:
prev_layer: Input tensor.
index:      Position in model_str to start parsing
Returns:
Output tensor of the series, end index in model_str.
Raises:
ValueError: If [] are unbalanced.'

def AddSeries(self, prev_layer, index):

    if (self.model_str[index] != '['):
        return (None, None)
    index += 1
    while ((index < len(self.model_str)) and (self.model_str[index] != ']')):
        (prev_layer, index) = self.BuildFromString(prev_layer, index)
    if (index == len(self.model_str)):
        raise ValueError(('Missing    ]    at    end    of    series!' + self.model_str))
    return (prev_layer, (index + 1))
