File size: 162 Bytes
f3b11f9
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
import copy

import torch.nn as nn


def clones(module, N):
    "Produce N identical layers."
    return nn.ModuleList([copy.deepcopy(module) for _ in range(N)])