class_docstr: Class that finds the edges whose IDs in parent graph appeared in exclude_eids.
  
  The edge IDs can be both CPU and GPU tensors.
class_docstr_tok: ["Class","that","finds","the","edges","whose","IDs","in","parent","graph","appeared","in","exclude_eids",".","The","edge","IDs","can","be","both","CPU","and","GPU","tensors","."]
code: def __call__(self, frontier, weights=None):
      parent_eids = frontier.edata[EID]
      located_eids = self._find_indices(parent_eids)
  
      if not isinstance(located_eids, Mapping):
          # (BarclayII) If frontier already has a EID field and located_eids is empty,
          # the returned graph will keep EID intact.  Otherwise, EID will change
          # to the mapping from the new graph to the old frontier.
          # So we need to test if located_eids is empty, and do the remapping ourselves.
          if len(located_eids) > 0:
              frontier = transforms.remove_edges(
                  frontier, located_eids, store_ids=True
              )
              if (
                  weights is not None
                  and weights[0].shape[0] == frontier.num_edges()
              ):
                  weights[0] = F.gather_row(
                      weights[0], frontier.edata[EID]
                  )
              frontier.edata[EID] = F.gather_row(
                  parent_eids, frontier.edata[EID]
              )
      else:
          # (BarclayII) remove_edges only accepts removing one type of edges,
          # so I need to keep track of the edge IDs left one by one.
          new_eids = parent_eids.copy()
          for i, (k, v) in enumerate(located_eids.items()):
              if len(v) > 0:
                  frontier = transforms.remove_edges(
                      frontier, v, etype=k, store_ids=True
                  )
                  new_eids[k] = F.gather_row(
                      parent_eids[k], frontier.edges[k].data[EID]
                  )
                  if weights is not None and weights[i].shape[
                      0
                  ] == frontier.num_edges(k):
                      weights[i] = F.gather_row(
                          weights[i], frontier.edges[k].data[EID]
                      )
          frontier.edata[EID] = new_eids
      return frontier if weights is None else (frontier, weights)
  
file_path: dgl/python/dgl/sampling/utils.py
imports: from collections.abc import Mapping
  import numpy
  from ..None import backend, transforms, utils
  from ..base import EID
  from ..utils import recursive_apply, recursive_apply_pair
label_desc: Use image node_id 3 for calling the EidExcluder obj's underlying member method code with example usage: obj.__call__(frontier, weights) and returns: unknown