def forward(self, x):
    (image_one, image_two) = (self.augment1(x), self.augment2(x))
    online_proj_one = self.online_encoder(image_one)
    online_proj_two = self.online_encoder(image_two)
    online_pred_one = self.online_predictor(online_proj_one)
    online_pred_two = self.online_predictor(online_proj_two)
    with torch.no_grad():
        target_encoder = self._get_target_encoder()
        target_proj_one = target_encoder(image_one)
        target_proj_two = target_encoder(image_two)
    loss_one = loss_fn(online_pred_one, target_proj_two.detach())
    loss_two = loss_fn(online_pred_two, target_proj_one.detach())
    loss = (loss_one + loss_two)
    return loss.mean()
def forward(self, x):
    (image_one, image_two) = (self.augment1(x), self.augment2(x))
    online_proj_one = self.online_encoder(image_one)
    online_proj_two = self.online_encoder(image_two)
    online_pred_one = self.online_predictor(online_proj_one)
    online_pred_two = self.online_predictor(online_proj_two)
    with torch.no_grad():
        target_encoder = self._get_target_encoder()
        target_proj_one = target_encoder(image_one)
        target_proj_two = target_encoder(image_two)
    loss_one = loss_fn(online_pred_one, target_proj_two.detach())
    loss_two = loss_fn(online_pred_two, target_proj_one.detach())
    loss = (loss_one + loss_two)
    return loss.mean()