class_docstr: This is a abstract context-aware recommender. All the context-aware model should implement this class.
  The base context-aware recommender class provide the basic embedding function of feature fields which also
  contains a first-order part of feature fields.
class_docstr_tok: ["This","is","a","abstract","context-aware","recommender",".","All","the","context-aware","model","should","implement","this","class",".","The","base","context-aware","recommender","class","provide","the","basic","embedding","function","of","feature","fields","which","also","contains","a","first-order","part","of","feature","fields","."]
docstr: Embed the float feature columns
  
  Args:
      float_seq_fields (torch.LongTensor): The input tensor. shape of [batch_size, seq_len]
      mode (str): How to aggregate the embedding of feature in this field. default=mean
  
  Returns:
      torch.FloatTensor: The result embedding tensor of token sequence columns.
docstr_tok: ["Embed","the","float","feature","columns","Args",":","float_seq_fields","(","torch.LongTensor",")",":","The","input","tensor",".","shape","of","[","batch_size",",","seq_len","]","mode","(","str",")",":","How","to","aggregate","the","embedding","of","feature","in","this","field",".","default=mean","Returns",":","torch.FloatTensor",":","The","result","embedding","tensor","of","token","sequence","columns","."]
code: def embed_float_seq_fields(self, float_seq_fields, mode="mean"):
      """Embed the float feature columns
  
      Args:
          float_seq_fields (torch.LongTensor): The input tensor. shape of [batch_size, seq_len]
          mode (str): How to aggregate the embedding of feature in this field. default=mean
  
      Returns:
          torch.FloatTensor: The result embedding tensor of token sequence columns.
      """
      # input is a list of Tensor shape of [batch_size, seq_len, 2]
      fields_result = []
      for i, float_seq_field in enumerate(float_seq_fields):
          embedding_table = self.float_seq_embedding_table[i]
          base, index = torch.split(float_seq_field, [1, 1], dim=-1)
          index = index.squeeze(-1)
          mask = index != 0  # [batch_size, seq_len]
          mask = mask.float()
          value_cnt = torch.sum(
              mask, dim=1, keepdim=True
          )  # [batch_size, 1]
  
          float_seq_embedding = base * embedding_table(
              index.long()
          )  # [batch_size, seq_len, embed_dim]
  
          mask = mask.unsqueeze(2).expand_as(
              float_seq_embedding
          )  # [batch_size, seq_len, embed_dim]
          if mode == "max":
              masked_float_seq_embedding = (
                  float_seq_embedding - (1 - mask) * 1e9
              )  # [batch_size, seq_len, embed_dim]
              result = torch.max(
                  masked_float_seq_embedding, dim=1, keepdim=True
              )  # [batch_size, 1, embed_dim]
          elif mode == "sum":
              masked_float_seq_embedding = (
                  float_seq_embedding * mask.float()
              )
              result = torch.sum(
                  masked_float_seq_embedding, dim=1, keepdim=True
              )  # [batch_size, 1, embed_dim]
          else:
              masked_float_seq_embedding = (
                  float_seq_embedding * mask.float()
              )
              result = torch.sum(
                  masked_float_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]
          fields_result.append(result)
      if len(fields_result) == 0:
          return None
      else:
          return torch.cat(fields_result, dim=1)
  
imports: from logging import getLogger
  import numpy
  import torch
  import torch.nn
  from recbole.model.layers import FMEmbedding, FMFirstOrderLinear, FLEmbedding
  from recbole.utils import ModelType, InputType, FeatureSource, FeatureType, set_color
label_desc: Use image node_id 3 for calling the ContextRecommender obj's underlying member method code with example usage: obj.embed_float_seq_fields(float_seq_fields, mode) and returns: None, torch