Includes only some features of the dataset in a dataloader

I created a dataset and to creat a dataloader with Pytorch. I have the following problem, I would like to create a dataloader with only the features data and y_vector. As I apply if I want the nth element of the test_dataset if I don’t include z_vector I can’t understand which element of z_vector I have to take. I do not have to give in input z_vector to the network and it seems useless to include it in the dataloader. How to do?

class Dataset():

    def __init__(self, X_np_array, y_np_vector,z_np_vector, transform=None): 

        self.transform = transform = torch.Tensor(X_np_array[:,None, :, :])
        self.y_vector = torch.Tensor(y_np_vector)
        self.z_np_vector= torch.Tensor(z_np_vector)

    def __getitem__(self, index): 
        return[index], self.y_vector[index],self.z_np_vector[index]

    def __len__(self): 
        return len(list(
    def train_test_split(self,dataset,splitting_percentage):

        train_dim = int(len(dataset)*splitting_percentage)
        test_dim = len(dataset)-train_dim
        train_dataset, test_dataset =, [train_dim, test_dim])
        return train_dataset, test_dataset

I’m not sure I understand the issue correctly, so please add more information in case I misunderstand it indeed.

Wouldn’t removing self.z_np_vector work in this case? It seems, this particular tensor is also not needed in the model, so I’m unsure why it’s still there.

However, this description seems to point towards a usage of this tensor:

Where is this tensor used, if not in the model?