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 __init__(self, exclude_eids):
      device = None
      if isinstance(exclude_eids, Mapping):
          for _, v in exclude_eids.items():
              if device is None:
                  device = F.context(v)
                  break
      else:
          device = F.context(exclude_eids)
      self._exclude_eids = None
      self._filter = None
  
      if device == F.cpu():
          # TODO(nv-dlasalle): Once Filter is implemented for the CPU, we
          # should just use that irregardless of the device.
          self._exclude_eids = (
              recursive_apply(exclude_eids, F.zerocopy_to_numpy)
              if exclude_eids is not None
              else None
          )
      else:
          self._filter = recursive_apply(exclude_eids, utils.Filter)
  
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 1 to create a new EidExcluder object from inherited base classes: object with example: obj = EidExcluder(exclude_eids)