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 whole feature columns.
  
  Args:
      interaction (Interaction): The input data collection.
  
  Returns:
      torch.FloatTensor: The embedding tensor of token sequence columns.
      torch.FloatTensor: The embedding tensor of float sequence columns.
docstr_tok: ["Embed","the","whole","feature","columns",".","Args",":","interaction","(","Interaction",")",":","The","input","data","collection",".","Returns",":","torch.FloatTensor",":","The","embedding","tensor","of","token","sequence","columns",".","torch.FloatTensor",":","The","embedding","tensor","of","float","sequence","columns","."]
code: def embed_input_fields(self, interaction):
      """Embed the whole feature columns.
  
      Args:
          interaction (Interaction): The input data collection.
  
      Returns:
          torch.FloatTensor: The embedding tensor of token sequence columns.
          torch.FloatTensor: The embedding tensor of float sequence columns.
      """
      float_fields = []
      for field_name in self.float_field_names:
          if len(interaction[field_name].shape) == 3:
              float_fields.append(interaction[field_name])
          else:
              float_fields.append(interaction[field_name].unsqueeze(1))
      if len(float_fields) > 0:
          float_fields = torch.cat(
              float_fields, dim=1
          )  # [batch_size, num_float_field, 2]
      else:
          float_fields = None
      # [batch_size, num_float_field] or [batch_size, num_float_field, embed_dim] or None
      float_fields_embedding = self.embed_float_fields(float_fields)
  
      float_seq_fields = []
      for field_name in self.float_seq_field_names:
          float_seq_fields.append(interaction[field_name])
  
      float_seq_fields_embedding = self.embed_float_seq_fields(
          float_seq_fields
      )
  
      if float_fields_embedding is None:
          dense_embedding = float_seq_fields_embedding
      else:
          if float_seq_fields_embedding is None:
              dense_embedding = float_fields_embedding
          else:
              dense_embedding = torch.cat(
                  [float_seq_fields_embedding, float_fields_embedding],
                  dim=1,
              )
  
      token_fields = []
      for field_name in self.token_field_names:
          token_fields.append(interaction[field_name].unsqueeze(1))
      if len(token_fields) > 0:
          token_fields = torch.cat(
              token_fields, dim=1
          )  # [batch_size, num_token_field, 2]
      else:
          token_fields = None
      # [batch_size, num_token_field, embed_dim] or None
      token_fields_embedding = self.embed_token_fields(token_fields)
  
      token_seq_fields = []
      for field_name in self.token_seq_field_names:
          token_seq_fields.append(interaction[field_name])
      # [batch_size, num_token_seq_field, embed_dim] or None
      token_seq_fields_embedding = self.embed_token_seq_fields(
          token_seq_fields
      )
  
      if token_fields_embedding is None:
          sparse_embedding = token_seq_fields_embedding
      else:
          if token_seq_fields_embedding is None:
              sparse_embedding = token_fields_embedding
          else:
              sparse_embedding = torch.cat(
                  [token_seq_fields_embedding, token_fields_embedding],
                  dim=1,
              )
  
      # sparse_embedding shape: [batch_size, num_token_seq_field+num_token_field, embed_dim] or None
      # dense_embedding shape: [batch_size, num_float_field, 2] or [batch_size, num_float_field, embed_dim] or None
      return sparse_embedding, dense_embedding
  
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 8 for calling the ContextRecommender obj's underlying member method code with example usage: obj.embed_input_fields(interaction) and returns: sparse_embedding,  dense_embedding