class_docstr: XCollector is a data collector which takes processed related prediction probabilities to calculate Fidelity+
  and Fidelity-.
  
  Args:
      sparsity (float): The Sparsity is use to transform the soft mask to a hard one.
  
  .. note::
      For more examples, see `benchmarks/xgraph
      <https://github.com/divelab/DIG/tree/dig/benchmarks/xgraph>`_.
docstr: Return the Fidelity+ value according to collected data.
  
  .. note::
      Please refer to `Explainability in Graph Neural Networks: A Taxonomic Survey
      <https://arxiv.org/abs/2012.15445>`_ for details.
docstr_tok: ["Return","the","Fidelity+","value","according","to","collected","data",".","..","note",":",":","Please","refer","to","`","Explainability","in","Graph","Neural","Networks",":","A","Taxonomic","Survey","<","https",":","\/\/arxiv.org\/abs\/2012.15445",">","`","_","for","details","."]
code: def fidelity(self):
      r"""
      Return the Fidelity+ value according to collected data.
  
      .. note::
          Please refer to `Explainability in Graph Neural Networks: A Taxonomic Survey
          <https://arxiv.org/abs/2012.15445>`_ for details.
      """
      if self.__fidelity is not None:
          return self.__fidelity
      else:
          if (
              None in self.__related_preds["maskout"]
              or None in self.__related_preds["origin"]
          ):
              return None
          else:
              mask_out_preds, one_mask_preds = torch.tensor(
                  self.__related_preds["maskout"]
              ), torch.tensor(self.__related_preds["origin"])
  
              self.__fidelity = fidelity(one_mask_preds, mask_out_preds)
              return self.__fidelity
  
imports: import torch
  import torch.nn
  from typing import List, Union
  from torch import Tensor
  import numpy
  from torch_geometric.data.data import Data
  from torch_geometric.nn import MessagePassing
label_desc: Use image node_id 5 for calling the XCollector obj's underlying member method code with example usage: obj.fidelity() and returns: self, None, self