Extracting tensor from tuple

I am trying to extract tensor data from the MNIST data set. Essentially I want to remove the data labels from the tuple. The standard ConcatDataset is set up using the following:

def init(self, *datasets):
self.datasets = datasets

def getitem(self, i):
return tuple(d[i] for d in self.datasets)

def len(self):
return min(len(d) for d in self.datasets)

The issue is I’m not sure how to use indexing to extract the tensors from d[i] to remove the labels. d[i] has structure of tuple((tensor(), label),(tensor(), label)), so I should be able to extract the tensors and append to a new tuple to get rid of the labels, but this has tripped me up a bit. Any help would be appreciated.