class_docstr: AFM is a attention based FM model that predict the final score with the attention of input feature.
class_docstr_tok: ["AFM","is","a","attention","based","FM","model","that","predict","the","final","score","with","the","attention","of","input","feature","."]
docstr: Build the cross feature columns of feature columns
  
  Args:
      feat_emb (torch.FloatTensor): input feature embedding tensor. shape of [batch_size, field_size, embed_dim].
  
  Returns:
      tuple:
          - torch.FloatTensor: Left part of the cross feature. shape of [batch_size, num_pairs, emb_dim].
          - torch.FloatTensor: Right part of the cross feature. shape of [batch_size, num_pairs, emb_dim].
docstr_tok: ["Build","the","cross","feature","columns","of","feature","columns","Args",":","feat_emb","(","torch.FloatTensor",")",":","input","feature","embedding","tensor",".","shape","of","[","batch_size",",","field_size",",","embed_dim","]",".","Returns",":","tuple",":","-","torch.FloatTensor",":","Left","part","of","the","cross","feature",".","shape","of","[","batch_size",",","num_pairs",",","emb_dim","]",".","-","torch.FloatTensor",":","Right","part","of","the","cross","feature",".","shape","of","[","batch_size",",","num_pairs",",","emb_dim","]","."]
code: def build_cross(self, feat_emb):
      """Build the cross feature columns of feature columns
  
      Args:
          feat_emb (torch.FloatTensor): input feature embedding tensor. shape of [batch_size, field_size, embed_dim].
  
      Returns:
          tuple:
              - torch.FloatTensor: Left part of the cross feature. shape of [batch_size, num_pairs, emb_dim].
              - torch.FloatTensor: Right part of the cross feature. shape of [batch_size, num_pairs, emb_dim].
      """
      # 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]
      return p, q
  
file_path: RecBole/recbole/model/context_aware_recommender/afm.py
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 AttLayer
label_desc: Use image node_id 3 for calling the AFM obj's underlying member method code with example usage: obj.build_cross(feat_emb) and returns: p,  q