class_docstr: This is Cross&Compress Unit for MKR model to model feature interactions between items and entities.
class_docstr_tok: ["This","is","Cross","&","Compress","Unit","for","MKR","model","to","model","feature","interactions","between","items","and","entities","."]
code: def forward(self, inputs):
      v, e = inputs
      # [batch_size, dim, 1], [batch_size, 1, dim]
      v = torch.unsqueeze(v, 2)
      e = torch.unsqueeze(e, 1)
      # [batch_size, dim, dim]
      c_matrix = torch.matmul(v, e)
      c_matrix_transpose = c_matrix.permute(0, 2, 1)
      # [batch_size * dim, dim]
      c_matrix = c_matrix.view(-1, self.dim)
      c_matrix_transpose = c_matrix_transpose.contiguous().view(
          -1, self.dim
      )
      # [batch_size, dim]
      v_intermediate = self.fc_vv(c_matrix) + self.fc_ev(
          c_matrix_transpose
      )
      e_intermediate = self.fc_ve(c_matrix) + self.fc_ee(
          c_matrix_transpose
      )
      v_output = v_intermediate.view(-1, self.dim)
      e_output = e_intermediate.view(-1, self.dim)
  
      return v_output, e_output
  
file_path: RecBole/recbole/model/knowledge_aware_recommender/mkr.py
imports: import torch
  import torch.nn
  from recbole.model.abstract_recommender import KnowledgeRecommender
  from recbole.model.init import xavier_normal_initialization
  from recbole.model.layers import MLPLayers
  from recbole.utils import InputType
label_desc: Use image node_id 2 for calling the CrossCompressUnit obj's underlying member method code with example usage: obj.forward(inputs) and returns: v_output,  e_output