(self)
| 559 | return sum(len(layer) for layer in self.layers.values()) |
| 560 | |
| 561 | def __iter__(self) -> Iterator[Key]: |
| 562 | return iter(self.to_dict()) |
| 563 | |
| 564 | def to_dict(self) -> dict[Key, Any]: |
| 565 | """Efficiently convert to plain dict. This method is faster than dict(self).""" |