Remove the .data usage, as it could break your code and use .item() instead:
    losses.update(loss_triplet.item(), num_items)
    accs.update(acc.item(), num_items)
    emb_norms.update(loss_embed.item())
    mask_norms.update(loss_mask.item())