MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / _get_clones

Function _get_clones

models/aios/transformer.py:1547–1551  ·  view source on GitHub ↗
(module, N, layer_share=False)

Source from the content-addressed store, hash-verified

1545
1546
1547def _get_clones(module, N, layer_share=False):
1548 if layer_share:
1549 return nn.ModuleList([module for i in range(N)])
1550 else:
1551 return nn.ModuleList([copy.deepcopy(module) for i in range(N)])
1552
1553
1554def build_transformer(args):

Callers 3

__init__Method · 0.70
__init__Method · 0.70
__init__Method · 0.70

Calls 1

deepcopyMethod · 0.80

Tested by

no test coverage detected