Source code for topobenchmarkx.transforms.feature_liftings.identity
"""Identity transform that does nothing to the input data."""
import torch_geometric
[docs]
class Identity(torch_geometric.transforms.BaseTransform):
r"""An identity transform that does nothing to the input data.
Parameters
----------
**kwargs : optional
Parameters for the base transform.
"""
def __init__(self, **kwargs):
super().__init__()
self.type = "domain2domain"
self.parameters = kwargs
def __repr__(self) -> str:
return f"{self.__class__.__name__}(type={self.type!r}, parameters={self.parameters!r})"
[docs]
def forward(self, data: torch_geometric.data.Data):
r"""Apply the transform to the input data.
Parameters
----------
data : torch_geometric.data.Data
The input data.
Returns
-------
torch_geometric.data.Data
The same data.
"""
return data