(self, idx)
| 205 | self.add_module(name, module) |
| 206 | |
| 207 | def __getitem__(self, idx): |
| 208 | if not (-len(self) <= idx < len(self)): |
| 209 | raise IndexError("index {} is out of range".format(idx)) |
| 210 | if idx < 0: |
| 211 | idx += len(self) |
| 212 | it = iter(self._modules.values()) |
| 213 | for i in range(idx): |
| 214 | next(it) |
| 215 | return next(it) |
| 216 | |
| 217 | def __len__(self): |
| 218 | return len(self._modules) |
nothing calls this directly
no outgoing calls
no test coverage detected