mirror of
https://github.com/labmlai/annotated_deep_learning_paper_implementations.git
synced 2025-08-16 19:01:12 +08:00
10 lines
200 B
Python
10 lines
200 B
Python
import copy
|
|
|
|
from torch import nn
|
|
|
|
from labml.helpers.pytorch.module import Module
|
|
|
|
|
|
def clone_module_list(module: Module, n: int):
|
|
return nn.ModuleList([copy.deepcopy(module) for _ in range(n)])
|