class_docstr: GCMC is a model that incorporate graph autoencoders for recommendation.
  
  Graph autoencoders are comprised of:
  
  1) a graph encoder model :math:`Z = f(X; A)`, which take as input an :math:`N \times D` feature matrix X and
  a graph adjacency matrix A, and produce an :math:`N \times E` node embedding matrix
  :math:`Z = [z_1^T,..., z_N^T ]^T`;
  
  2) a pairwise decoder model :math:`\hat A = g(Z)`, which takes pairs of node embeddings :math:`(z_i, z_j)` and
  predicts respective entries :math:`\hat A_{ij}` in the adjacency matrix.
  
  Note that :math:`N` denotes the number of nodes, :math:`D` the number of input features,
  and :math:`E` the embedding size.
  
  We implement the model following the original author with a pairwise training mode.
class_docstr_tok: ["GCMC","is","a","model","that","incorporate","graph","autoencoders","for","recommendation",".","Graph","autoencoders","are","comprised","of",":","1",")","a","graph","encoder","model",":","math",":","`","Z","=","f","(","X",";","A",")","`",",","which","take","as","input","an",":","math",":","`","N","\\times","D","`","feature","matrix","X","and","a","graph","adjacency","matrix","A",",","and","produce","an",":","math",":","`","N","\\times","E","`","node","embedding","matrix",":","math",":","`","Z","=","[","z_1^T",",","...",",","z_N^T","]","^T","`",";","2",")","a","pairwise","decoder","model",":","math",":","`","\\hat","A","=","g","(","Z",")","`",",","which","takes","pairs","of","node","embeddings",":","math",":","`","(","z_i",",","z_j",")","`","and","predicts","respective","entries",":","math",":","`","\\hat","A_","{","ij","}","`","in","the","adjacency","matrix",".","Note","that",":","math",":","`","N","`","denotes","the","number","of","nodes",",",":","math",":","`","D","`","the","number","of","input","features",",","and",":","math",":","`","E","`","the","embedding","size",".","We","implement","the","model","following","the","original","author","with","a","pairwise","training","mode","."]
docstr: Get the normalized sparse eye matrix.
  
  Construct the sparse eye matrix as node feature.
  
  Args:
      num: the number of rows
  
  Returns:
      Sparse tensor of the normalized interaction matrix.
docstr_tok: ["Get","the","normalized","sparse","eye","matrix",".","Construct","the","sparse","eye","matrix","as","node","feature",".","Args",":","num",":","the","number","of","rows","Returns",":","Sparse","tensor","of","the","normalized","interaction","matrix","."]
code: def get_sparse_eye_mat(self, num):
      r"""Get the normalized sparse eye matrix.
  
      Construct the sparse eye matrix as node feature.
  
      Args:
          num: the number of rows
  
      Returns:
          Sparse tensor of the normalized interaction matrix.
      """
      i = torch.LongTensor([range(0, num), range(0, num)])
      val = torch.FloatTensor([1] * num)
      return torch.sparse.FloatTensor(i, val)
  
imports: import math
  import numpy
  import scipy.sparse
  import torch
  import torch.nn
  from recbole.model.abstract_recommender import GeneralRecommender
  from recbole.model.layers import SparseDropout
  from recbole.utils import InputType
label_desc: Use image node_id 2 for calling the GCMC obj's underlying member method code with example usage: obj.get_sparse_eye_mat(num) and returns: torch