class_docstr: OuterProduct Layer used in PNN. This implementation is
  adapted from code that the author of the paper published on https://github.com/Atomu2014/product-nets.
class_docstr_tok: ["OuterProduct","Layer","used","in","PNN",".","This","implementation","is","adapted","from","code","that","the","author","of","the","paper","published","on","https",":","\/\/github.com\/Atomu2014\/product-nets","."]
docstr: Args:
      feat_emb(torch.FloatTensor) :3D tensor with shape: [batch_size,num_pairs,embedding_size].
  
  Returns:
      outer_product(torch.FloatTensor): The outer product of input tensor. shape of [batch_size, num_pairs]
docstr_tok: ["Args",":","feat_emb","(","torch.FloatTensor",")",":3D","tensor","with","shape",":","[","batch_size",",","num_pairs",",","embedding_size","]",".","Returns",":","outer_product","(","torch.FloatTensor",")",":","The","outer","product","of","input","tensor",".","shape","of","[","batch_size",",","num_pairs","]"]
code: def forward(self, feat_emb):
      """
      Args:
          feat_emb(torch.FloatTensor) :3D tensor with shape: [batch_size,num_pairs,embedding_size].
  
      Returns:
          outer_product(torch.FloatTensor): The outer product of input tensor. shape of [batch_size, num_pairs]
      """
      row = []
      col = []
      for i in range(self.num_feature_field - 1):
          for j in range(i + 1, self.num_feature_field):
              row.append(i)
              col.append(j)
      p = feat_emb[:, row]  # [batch_size, num_pairs, emb_dim]
      q = feat_emb[:, col]  # [batch_size, num_pairs, emb_dim]
  
      # -------------------------
  
      p.unsqueeze_(dim=1)  # [batch_size, 1, num_pairs, emb_dim]
  
      p = torch.mul(
          p, self.kernel.unsqueeze(0)
      )  # [batch_size,emb_dim,num_pairs,emb_dim]
      p = torch.sum(p, dim=-1)  # [batch_size,emb_dim,num_pairs]
      p = torch.transpose(p, 2, 1)  # [batch_size,num_pairs,emb_dim]
  
      outer_product = p * q
      return outer_product.sum(dim=-1)
  
imports: import torch
  import torch.nn
  from torch.nn.init import xavier_normal_, constant_
  from recbole.model.abstract_recommender import ContextRecommender
  from recbole.model.layers import MLPLayers
label_desc: Use image node_id 2 for calling the OuterProductLayer obj's underlying member method code with example usage: obj.forward(feat_emb) and returns: outer_product