class_docstr: The Graph Auto-Encoder model from the
  `"Variational Graph Auto-Encoders" <https://arxiv.org/abs/1611.07308>`_
  paper based on user-defined encoder and decoder models.
  
  Args:
      encoder (torch.nn.Module): The encoder module.
      decoder (torch.nn.Module, optional): The decoder module. If set to
          :obj:`None`, will default to the
          :class:`torch_geometric.nn.models.InnerProductDecoder`.
          (default: :obj:`None`)
class_docstr_tok: ["The","Graph","Auto-Encoder","model","from","the","`","``","Variational","Graph","Auto-Encoders","''","<","https",":","\/\/arxiv.org\/abs\/1611.07308",">","`","_","paper","based","on","user-defined","encoder","and","decoder","models",".","Args",":","encoder","(","torch.nn.Module",")",":","The","encoder","module",".","decoder","(","torch.nn.Module",",","optional",")",":","The","decoder","module",".","If","set","to",":","obj",":","`","None","`",",","will","default","to","the",":","class",":","`","torch_geometric.nn.models.InnerProductDecoder","`",".","(","default",":",":","obj",":","`","None","`",")"]
docstr: Given latent variables :obj:`z`, positive edges
  :obj:`pos_edge_index` and negative edges :obj:`neg_edge_index`,
  computes area under the ROC curve (AUC) and average precision (AP)
  scores.
  
  Args:
      z (torch.Tensor): The latent space :math:`\mathbf{Z}`.
      pos_edge_index (torch.Tensor): The positive edges to evaluate
          against.
      neg_edge_index (torch.Tensor): The negative edges to evaluate
          against.
docstr_tok: ["Given","latent","variables",":","obj",":","`","z","`",",","positive","edges",":","obj",":","`","pos_edge_index","`","and","negative","edges",":","obj",":","`","neg_edge_index","`",",","computes","area","under","the","ROC","curve","(","AUC",")","and","average","precision","(","AP",")","scores",".","Args",":","z","(","torch.Tensor",")",":","The","latent","space",":","math",":","`","\\mathbf","{","Z","}","`",".","pos_edge_index","(","torch.Tensor",")",":","The","positive","edges","to","evaluate","against",".","neg_edge_index","(","torch.Tensor",")",":","The","negative","edges","to","evaluate","against","."]
code: def test(
      self, z: Tensor, pos_edge_index: Tensor, neg_edge_index: Tensor
  ) -> Tuple[Tensor, Tensor]:
      r"""Given latent variables :obj:`z`, positive edges
      :obj:`pos_edge_index` and negative edges :obj:`neg_edge_index`,
      computes area under the ROC curve (AUC) and average precision (AP)
      scores.
  
      Args:
          z (torch.Tensor): The latent space :math:`\mathbf{Z}`.
          pos_edge_index (torch.Tensor): The positive edges to evaluate
              against.
          neg_edge_index (torch.Tensor): The negative edges to evaluate
              against.
      """
      from sklearn.metrics import average_precision_score, roc_auc_score
  
      pos_y = z.new_ones(pos_edge_index.size(1))
      neg_y = z.new_zeros(neg_edge_index.size(1))
      y = torch.cat([pos_y, neg_y], dim=0)
  
      pos_pred = self.decoder(z, pos_edge_index, sigmoid=True)
      neg_pred = self.decoder(z, neg_edge_index, sigmoid=True)
      pred = torch.cat([pos_pred, neg_pred], dim=0)
  
      y, pred = y.detach().cpu().numpy(), pred.detach().cpu().numpy()
  
      return roc_auc_score(y, pred), average_precision_score(y, pred)
  
imports: from typing import Optional, Tuple
  import torch
  from torch import Tensor
  from torch.nn import Module
  from torch_geometric.nn.inits import reset
  from torch_geometric.utils import negative_sampling
label_desc: Use image node_id 7 for calling the GAE obj's underlying member method code with example usage: obj.test(z, pos_edge_index, neg_edge_index) and returns: roc_auc_score,  average_precision_score