class_docstr: This is Field-Aware Factorization Machine Module for FFM.
code: def _emb_token_seq_ffm_input(self, token_seq_ffm_input):
      # get token_seq field-aware embeddings
      token_seq_input_x_emb = []
      if len(self.token_seq_feature_names) > 0:
          for i in range(self.num_fields):
              token_seq_result = []
              for j, token_seq in enumerate(token_seq_ffm_input):
                  embedding_table = self.token_seq_embeddings[i][j]
                  mask = token_seq != 0  # [batch_size, seq_len]
                  mask = mask.float()
                  value_cnt = torch.sum(
                      mask, dim=1, keepdim=True
                  )  # [batch_size, 1]
  
                  token_seq_embedding = embedding_table(
                      token_seq
                  )  # [batch_size, seq_len, embed_dim]
                  mask = mask.unsqueeze(2).expand_as(
                      token_seq_embedding
                  )  # [batch_size, seq_len, embed_dim]
                  # mean
                  masked_token_seq_embedding = (
                      token_seq_embedding * mask.float()
                  )
                  result = torch.sum(
                      masked_token_seq_embedding, dim=1
                  )  # [batch_size, embed_dim]
                  eps = torch.FloatTensor([1e-8]).to(self.device)
                  result = torch.div(
                      result, value_cnt + eps
                  )  # [batch_size, embed_dim]
                  result = result.unsqueeze(
                      1
                  )  # [batch_size, 1, embed_dim]
  
                  token_seq_result.append(result)
              token_seq_input_x_emb.append(
                  torch.cat(token_seq_result, dim=1)
              )  # [num_fields: batch_size, num_token_seq_features, embed_dim]
  
      return token_seq_input_x_emb
  
imports: import numpy
  import torch
  import torch.nn
  from torch.nn.init import xavier_normal_, constant_
  from recbole.model.abstract_recommender import ContextRecommender
label_desc: Use image node_id 6 for calling the FieldAwareFactorizationMachine obj's underlying member method code with example usage: obj._emb_token_seq_ffm_input(token_seq_ffm_input) and returns: token_seq_input_x_emb