def __init__(self, config, vis):
    super(Encoder, self).__init__()
    self.vis = vis
    self.layer = nn.ModuleList()
    self.encoder_norm = LayerNorm(config.hidden_size, eps=1e-06)
    for _ in range(config.transformer['num_layers']):
        layer = Block(config, vis)
        self.layer.append(copy.deepcopy(layer))
def __init__(self, config, vis):
    super(Encoder, self).__init__()
    self.vis = vis
    self.layer = nn.ModuleList()
    self.encoder_norm = LayerNorm(config.hidden_size, eps=1e-06)
    for _ in range(config.transformer['num_layers']):
        layer = Block(config, vis)
        self.layer.append(copy.deepcopy(layer))