class_docstr: This is a common part of auto-encoders. All the auto-encoder models should inherit this class,
  including CDAE, MacridVAE, MultiDAE, MultiVAE, RaCT and RecVAE.
  The base AutoEncoderMixin class provides basic dataset information and rating matrix function.
class_docstr_tok: ["This","is","a","common","part","of","auto-encoders",".","All","the","auto-encoder","models","should","inherit","this","class",",","including","CDAE",",","MacridVAE",",","MultiDAE",",","MultiVAE",",","RaCT","and","RecVAE",".","The","base","AutoEncoderMixin","class","provides","basic","dataset","information","and","rating","matrix","function","."]
docstr: Get a batch of user's feature with the user's id and history interaction matrix.
  
  Args:
      user (torch.LongTensor): The input tensor that contains user's id, shape: [batch_size, ]
  
  Returns:
      torch.FloatTensor: The user's feature of a batch of user, shape: [batch_size, n_items]
docstr_tok: ["Get","a","batch","of","user","'s","feature","with","the","user","'s","id","and","history","interaction","matrix",".","Args",":","user","(","torch.LongTensor",")",":","The","input","tensor","that","contains","user","'s","id",",","shape",":","[","batch_size",",","]","Returns",":","torch.FloatTensor",":","The","user","'s","feature","of","a","batch","of","user",",","shape",":","[","batch_size",",","n_items","]"]
code: def get_rating_matrix(self, user):
      r"""Get a batch of user's feature with the user's id and history interaction matrix.
  
      Args:
          user (torch.LongTensor): The input tensor that contains user's id, shape: [batch_size, ]
  
      Returns:
          torch.FloatTensor: The user's feature of a batch of user, shape: [batch_size, n_items]
      """
      # Following lines construct tensor of shape [B,n_items] using the tensor of shape [B,H]
      col_indices = self.history_item_id[user].flatten()
      row_indices = torch.arange(user.shape[0]).repeat_interleave(
          self.history_item_id.shape[1], dim=0
      )
      rating_matrix = torch.zeros(1, device=self.device).repeat(
          user.shape[0], self.n_items
      )
      rating_matrix.index_put_(
          (row_indices, col_indices),
          self.history_item_value[user].flatten(),
      )
      return rating_matrix
  
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 2 for calling the AutoEncoderMixin obj's underlying member method code with example usage: obj.get_rating_matrix(user) and returns: rating_matrix