Well so the Data object that you create doesn’t inherently have a train_mask, val_mask, or test_mask but if you want, you can define these as  tensors  and add them as attributes to your Data object. In other words, the Data object is extendable (see https://pytorch-geometric.readthedocs.io/en/latest/modules/data.html 186).

data = Data(x=x, edge_index=edge_index)
data.train_idx = torch.tensor([…], dtype=torch.long)
data.test_mask = torch.tensor([…], dtype=torch.uint8)

Another way to do this would be to create a separate Data object for your training, testing and validation data sets. This is perhaps preferable because there is less likelihood of data peeking if the data is stored in completely separate objects.