torch_geometric.transforms.IndexToMask
- class IndexToMask(attrs: Optional[Union[str, List[str]]] = None, sizes: Optional[Union[int, List[int]]] = None, replace: bool = False)[source]
Bases:
BaseTransformConverts indices to a mask representation (functional name:
index_to_mask).- Parameters
attrs (str, [str], optional) – If given, will only perform index to mask conversion for the given attributes. If omitted, will infer the attributes from the suffix
_index. (default:None)sizes (int, [int], optional) – The size of the mask. If set to
None, an automatically sized tensor is returned. The number of nodes will be used by default, except for edge attributes which will use the number of edges as the mask size. (default:None)replace (bool, optional) – if set to
Truereplaces the index attributes with mask tensors. (default:False)