class_docstr: NCL is a neighborhood-enriched contrastive learning paradigm for graph collaborative filtering.
  Both structural and semantic neighbors are explicitly captured as contrastive learning objects.
class_docstr_tok: ["NCL","is","a","neighborhood-enriched","contrastive","learning","paradigm","for","graph","collaborative","filtering",".","Both","structural","and","semantic","neighbors","are","explicitly","captured","as","contrastive","learning","objects","."]
code: def forward(self):
      all_embeddings = self.get_ego_embeddings()
      embeddings_list = [all_embeddings]
      for layer_idx in range(max(self.n_layers, self.hyper_layers * 2)):
          all_embeddings = torch.sparse.mm(
              self.norm_adj_mat, all_embeddings
          )
          embeddings_list.append(all_embeddings)
  
      lightgcn_all_embeddings = torch.stack(
          embeddings_list[: self.n_layers + 1], dim=1
      )
      lightgcn_all_embeddings = torch.mean(
          lightgcn_all_embeddings, dim=1
      )
  
      user_all_embeddings, item_all_embeddings = torch.split(
          lightgcn_all_embeddings, [self.n_users, self.n_items]
      )
      return user_all_embeddings, item_all_embeddings, embeddings_list
  
imports: import numpy
  import scipy.sparse
  import torch
  import torch.nn.functional
  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
label_desc: Use image node_id 6 for calling the NCL obj's underlying member method code with example usage: obj.forward() and returns: user_all_embeddings,  item_all_embeddings,  embeddings_list