class_docstr: SGL is a GCN-based recommender model.
  
  SGL supplements the classical supervised task of recommendation with an auxiliary
  self supervised task, which reinforces node representation learning via self-
  discrimination.Specifically,SGL generates multiple views of a node, maximizing the
  agreement between different views of the same node compared to that of other nodes.
  SGL devises three operators to generate the views — node dropout, edge dropout, and
  random walk — that change the graph structure in different manners.
  
  We implement the model following the original author with a pairwise training mode.
docstr: Calculate the the pairwise Bayesian Personalized Ranking (BPR) loss and parameter regularization loss.
  
  Args:
      user_emd (torch.Tensor): Ego embedding of all users after forwarding.
      item_emd (torch.Tensor): Ego embedding of all items after forwarding.
      user_list (torch.Tensor): List of the user.
      pos_item_list (torch.Tensor): List of positive examples.
      neg_item_list (torch.Tensor): List of negative examples.
  
  Returns:
      torch.Tensor: Loss of BPR tasks and parameter regularization.
docstr_tok: ["Calculate","the","the","pairwise","Bayesian","Personalized","Ranking","(","BPR",")","loss","and","parameter","regularization","loss",".","Args",":","user_emd","(","torch.Tensor",")",":","Ego","embedding","of","all","users","after","forwarding",".","item_emd","(","torch.Tensor",")",":","Ego","embedding","of","all","items","after","forwarding",".","user_list","(","torch.Tensor",")",":","List","of","the","user",".","pos_item_list","(","torch.Tensor",")",":","List","of","positive","examples",".","neg_item_list","(","torch.Tensor",")",":","List","of","negative","examples",".","Returns",":","torch.Tensor",":","Loss","of","BPR","tasks","and","parameter","regularization","."]
code: def calc_bpr_loss(
      self, user_emd, item_emd, user_list, pos_item_list, neg_item_list
  ):
      r"""Calculate the the pairwise Bayesian Personalized Ranking (BPR) loss and parameter regularization loss.
  
      Args:
          user_emd (torch.Tensor): Ego embedding of all users after forwarding.
          item_emd (torch.Tensor): Ego embedding of all items after forwarding.
          user_list (torch.Tensor): List of the user.
          pos_item_list (torch.Tensor): List of positive examples.
          neg_item_list (torch.Tensor): List of negative examples.
  
      Returns:
          torch.Tensor: Loss of BPR tasks and parameter regularization.
      """
      u_e = user_emd[user_list]
      pi_e = item_emd[pos_item_list]
      ni_e = item_emd[neg_item_list]
      p_scores = torch.mul(u_e, pi_e).sum(dim=1)
      n_scores = torch.mul(u_e, ni_e).sum(dim=1)
  
      l1 = torch.sum(-F.logsigmoid(p_scores - n_scores))
  
      u_e_p = self.user_embedding(user_list)
      pi_e_p = self.item_embedding(pos_item_list)
      ni_e_p = self.item_embedding(neg_item_list)
  
      l2 = self.reg_loss(u_e_p, pi_e_p, ni_e_p)
  
      return l1 + l2 * self.reg_weight
  
imports: import numpy
  import scipy.sparse
  import torch
  from recbole.model.abstract_recommender import GeneralRecommender
  from recbole.model.init import xavier_uniform_initialization
  from recbole.model.loss import BPRLoss, EmbLoss
  from recbole.utils import InputType
  import torch.nn.functional
label_desc: Use image node_id 8 for calling the SGL obj's underlying member method code with example usage: obj.calc_bpr_loss(user_emd, item_emd, user_list, pos_item_list, neg_item_list) and returns: unknown