code: def binary_adj_converter(a_in):
      """
      Transforms a graph matrix into the binary adjacency matrix.
      **Arguments**
      - `a_in`: sparse `(n_nodes, n_nodes)` graph tensor;
      """
      a_idx = a_in.indices
      off_diag_idx = tf.not_equal(a_idx[:, 0], a_idx[:, 1])
      a_idx = a_idx[off_diag_idx]
  
      a = tf.sparse.SparseTensor(
          a_idx, tf.ones(a_idx.shape[0], dtype=tf.float32), a_in.shape
      )
      return a
  
file_path: spektral/spektral/models/gnn_explainer.py
imports: import networkx
  import numpy
  import tensorflow
  from scipy.sparse import csr_matrix
  from spektral.layers import MessagePassing
  from spektral.layers.convolutional.conv import Conv
  from spektral.layers.ops import dot
  from spektral.utils.sparse import sp_matrix_to_sp_tensor
label_desc: Use image node_id 2 for calling a global function with example usage: binary_adj_converter(a_in) and returns: a