mirror of
https://github.com/labmlai/annotated_deep_learning_paper_implementations.git
synced 2025-08-15 18:27:20 +08:00
10 lines
192 B
Python
10 lines
192 B
Python
import copy
|
|
|
|
from torch import nn
|
|
|
|
from labml_helpers.module import Module
|
|
|
|
|
|
def clone_module_list(module: Module, n: int):
|
|
return nn.ModuleList([copy.deepcopy(module) for _ in range(n)])
|