class_docstr: InnerProduct Layer used in PNN that compute the element-wise
  product or inner product between feature vectors.
class_docstr_tok: ["InnerProduct","Layer","used","in","PNN","that","compute","the","element-wise","product","or","inner","product","between","feature","vectors","."]
docstr: Args:
      feat_emb(torch.FloatTensor) :3D tensor with shape: [batch_size,num_pairs,embedding_size].
  
  Returns:
      inner_product(torch.FloatTensor): The inner 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",":","inner_product","(","torch.FloatTensor",")",":","The","inner","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:
          inner_product(torch.FloatTensor): The inner product of input tensor. shape of [batch_size, num_pairs]
      """
      # num_pairs = num_feature_field * (num_feature_field-1) / 2
      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]
  
      inner_product = p * q
  
      return inner_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 InnerProductLayer obj's underlying member method code with example usage: obj.forward(feat_emb) and returns: inner_product