torch_geometric.transforms.MaskToIndex

class MaskToIndex(attrs: Optional[Union[str, List[str]]] = None, replace: bool = False)[source]

Bases: BaseTransform

Converts a mask to an index representation (functional name: mask_to_index).

Parameters:
  • 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 _mask (default: None)

  • replace (bool, optional) – if set to True replaces the mask attributes with index tensors. (default: False)