MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / WeightModuleList

Class WeightModuleList

lightx2v/common/modules/weight_module.py:191–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189
190
191class WeightModuleList(WeightModule):
192 def __init__(self, modules=None):
193 super().__init__()
194 self._list = []
195 if modules is not None:
196 for idx, module in enumerate(modules):
197 self.append(module)
198
199 def append(self, module):
200 idx = len(self._list)
201 self._list.append(module)
202 self.add_module(str(idx), module)
203
204 def __getitem__(self, idx):
205 return self._list[idx]
206
207 def __setitem__(self, idx, module):
208 self._list[idx] = module
209 self.add_module(str(idx), module)
210
211 def __len__(self):
212 return len(self._list)
213
214 def __iter__(self):
215 return iter(self._list)

Callers 15

__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
configure_modelMethod · 0.90
__init__Method · 0.90
configureMethod · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected