class_docstr: PNN calculate inner and outer product of feature embedding.
  You can choose the product option with the parameter of use_inner and use_outer
class_docstr_tok: ["PNN","calculate","inner","and","outer","product","of","feature","embedding",".","You","can","choose","the","product","option","with","the","parameter","of","use_inner","and","use_outer"]
code: def forward(self, interaction):
      pnn_all_embeddings = self.concat_embed_input_fields(
          interaction
      )  # [batch_size, num_field, embed_dim]
      batch_size = pnn_all_embeddings.shape[0]
      # linear part
      linear_part = pnn_all_embeddings.view(
          batch_size, -1
      )  # [batch_size,num_field*embed_dim]
      output = [linear_part]
      # second order part
      if self.use_inner:
          inner_product = self.inner_product(pnn_all_embeddings).view(
              batch_size, -1
          )  # [batch_size,num_pairs]
          output.append(inner_product)
      if self.use_outer:
          outer_product = self.outer_product(pnn_all_embeddings).view(
              batch_size, -1
          )  # [batch_size,num_pairs]
          output.append(outer_product)
      output = torch.cat(output, dim=1)  # [batch_size,d]
  
      output = self.predict_layer(
          self.mlp_layers(output)
      )  # [batch_size,1]
      return output.squeeze(-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 4 for calling the PNN obj's underlying member method code with example usage: obj.forward(interaction) and returns: output