code: def global_global_loss_(sup_enc, unsup_enc):
      num_graphs = sup_enc.shape[0]
      device = sup_enc.device
  
      pos_mask = th.eye(num_graphs).to(device)
      neg_mask = 1 - pos_mask
  
      res = th.mm(sup_enc, unsup_enc.t())
  
      E_pos = get_positive_expectation(res * pos_mask, average=False)
      E_pos = (E_pos * pos_mask).sum() / pos_mask.sum()
      E_neg = get_negative_expectation(res * neg_mask, average=False)
      E_neg = (E_neg * neg_mask).sum() / neg_mask.sum()
  
      return E_neg - E_pos
  
imports: import math
  import torch
  import torch.nn.functional
label_desc: Use image node_id 4 for calling a global function with example usage: global_global_loss_(sup_enc, unsup_enc) and returns: unknown