class_docstr: Converts a mask to an index representation
  (functional name: :obj:`mask_to_index`).
  
  Args:
      attrs (str, [str], optional): If given, will only perform mask to index
          conversion for the given attributes.  If omitted, will infer the
          attributes from the suffix :obj:`_mask` (default: :obj:`None`)
      replace (bool, optional): if set to :obj:`True` replaces the mask
          attributes with index tensors. (default: :obj:`False`)
class_docstr_tok: ["Converts","a","mask","to","an","index","representation","(","functional","name",":",":","obj",":","`","mask_to_index","`",")",".","Args",":","attrs","(","str",",","[","str","]",",","optional",")",":","If","given",",","will","only","perform","mask","to","index","conversion","for","the","given","attributes",".","If","omitted",",","will","infer","the","attributes","from","the","suffix",":","obj",":","`","_mask","`","(","default",":",":","obj",":","`","None","`",")","replace","(","bool",",","optional",")",":","if","set","to",":","obj",":","`","True","`","replaces","the","mask","attributes","with","index","tensors",".","(","default",":",":","obj",":","`","False","`",")"]
code: def __init__(
      self,
      attrs: Optional[Union[str, List[str]]] = None,
      replace: bool = False,
  ):
      self.attrs = [attrs] if isinstance(attrs, str) else attrs
      self.replace = replace
  
file_path: pytorch_geometric/torch_geometric/transforms/mask.py
imports: from typing import List, Optional, Sequence, Union
  from torch_geometric.data import Data, HeteroData
  from torch_geometric.data.datapipes import functional_transform
  from torch_geometric.data.storage import BaseStorage
  from torch_geometric.transforms import BaseTransform
  from torch_geometric.utils import index_to_mask, mask_to_index
label_desc: Use image node_id 1 to create a new MaskToIndex object from inherited base classes: BaseTransform with example: obj = MaskToIndex(attrs, replace)