class_docstr: Find closest anchors using :mod:`torch_sparse` on a GPU.
class_docstr_tok: ["Find","closest","anchors","using",":","mod",":","`","torch_sparse","`","on","a","GPU","."]
docstr: Initialize the tokenizer.
  
  :param max_iter:
      the number of partitions obtained through Metis.
  :param device:
      the device to use for tokenization
docstr_tok: ["Initialize","the","tokenizer",".",":","param","max_iter",":","the","number","of","partitions","obtained","through","Metis",".",":","param","device",":","the","device","to","use","for","tokenization"]
code: def __init__(self, max_iter: int = 5, device: DeviceHint = None):
      """Initialize the tokenizer.
  
      :param max_iter:
          the number of partitions obtained through Metis.
      :param device:
          the device to use for tokenization
      """
      self.max_iter = max_iter
      self.device = resolve_device(device)
  
imports: import logging
  from abc import ABC, abstractmethod
  from typing import Iterable, Optional
  import numpy
  import scipy.sparse
  import torch
  from class_resolver import ClassResolver, OptionalKwargs
  from torch_ppr import page_rank
  from torch_ppr.utils import edge_index_to_sparse_matrix, prepare_page_rank_adjacency, prepare_x0
  from tqdm.auto import tqdm
  from .utils import ensure_num_entities
  from ...typing import DeviceHint
  from ...utils import ExtraReprMixin, format_relative_comparison, resolve_device
label_desc: Use image node_id 1 to create a new SparseBFSSearcher object from inherited base classes: AnchorSearcher with example: obj = SparseBFSSearcher(max_iter, device)