def _make_index(self):
out = {}<EOL>for layer in self._layers:<EOL><INDENT>cls = layer.__class__<EOL>out[cls] = out.get(cls, []) + [layer]<EOL><DEDENT>return out<EOL>
Perform the index computation. It groups layers by type into a
dictionary, to allow quick access.