def forward(self, tensor, mask):
    tensor = (tensor + self.attention(tensor, mask=mask))
    tensor = _normalize(tensor, self.norm1)
    tensor = (tensor + self.ffn(tensor))
    tensor = _normalize(tensor, self.norm2)
    tensor *= mask.unsqueeze((- 1)).float()
    return tensor
def forward(self, tensor, mask):
    tensor = (tensor + self.attention(tensor, mask=mask))
    tensor = _normalize(tensor, self.norm1)
    tensor = (tensor + self.ffn(tensor))
    tensor = _normalize(tensor, self.norm2)
    tensor *= mask.unsqueeze((- 1)).float()
    return tensor