class_docstr: SRGNN regards the conversation history as a directed graph.
  In addition to considering the connection between the item and the adjacent item,
  it also considers the connection with other interactive items.
  
  Such as: A example of a session sequence(eg:item1, item2, item3, item2, item4) and the connection matrix A
  
  Outgoing edges:
      === ===== ===== ===== =====
       \    1     2     3     4
      === ===== ===== ===== =====
       1    0     1     0     0
       2    0     0    1/2   1/2
       3    0     1     0     0
       4    0     0     0     0
      === ===== ===== ===== =====
  
  Incoming edges:
      === ===== ===== ===== =====
       \    1     2     3     4
      === ===== ===== ===== =====
       1    0     0     0     0
       2   1/2    0    1/2    0
       3    0     1     0     0
       4    0     1     0     0
      === ===== ===== ===== =====
code: def _get_slice(self, item_seq):
      # Mask matrix, shape of [batch_size, max_session_len]
      mask = item_seq.gt(0)
      items, n_node, A, alias_inputs = [], [], [], []
      max_n_node = item_seq.size(1)
      item_seq = item_seq.cpu().numpy()
      for u_input in item_seq:
          node = np.unique(u_input)
          items.append(node.tolist() + (max_n_node - len(node)) * [0])
          u_A = np.zeros((max_n_node, max_n_node))
  
          for i in np.arange(len(u_input) - 1):
              if u_input[i + 1] == 0:
                  break
  
              u = np.where(node == u_input[i])[0][0]
              v = np.where(node == u_input[i + 1])[0][0]
              u_A[u][v] = 1
  
          u_sum_in = np.sum(u_A, 0)
          u_sum_in[np.where(u_sum_in == 0)] = 1
          u_A_in = np.divide(u_A, u_sum_in)
          u_sum_out = np.sum(u_A, 1)
          u_sum_out[np.where(u_sum_out == 0)] = 1
          u_A_out = np.divide(u_A.transpose(), u_sum_out)
          u_A = np.concatenate([u_A_in, u_A_out]).transpose()
          A.append(u_A)
  
          alias_inputs.append(
              [np.where(node == i)[0][0] for i in u_input]
          )
      # The relative coordinates of the item node, shape of [batch_size, max_session_len]
      alias_inputs = torch.LongTensor(alias_inputs).to(self.device)
      # The connecting matrix, shape of [batch_size, max_session_len, 2 * max_session_len]
      A = torch.FloatTensor(np.array(A)).to(self.device)
      # The unique item nodes, shape of [batch_size, max_session_len]
      items = torch.LongTensor(items).to(self.device)
  
      return alias_inputs, A, items, mask
  
imports: import math
  import numpy
  import torch
  from torch import nn
  from torch.nn import Parameter
  from torch.nn import functional
  from recbole.model.abstract_recommender import SequentialRecommender
  from recbole.model.loss import BPRLoss
label_desc: Use image node_id 3 for calling the SRGNN obj's underlying member method code with example usage: obj._get_slice(item_seq) and returns: alias_inputs,  A,  items,  mask