What happens when you iterate through the dataset without using the k-fold indices to subsample?
I couldn’t reproduce this behavior with a minimal example:
import torch
from torch.utils.data import TensorDataset, DataLoader
from sklearn.model_selection import KFold

inpts = torch.randn(32, 3, 224, 224)
tgts = torch.rand(32) > 0.5
dataset = TensorDataset(inpts, tgts)

kfolds = 8
kfold = KFold(n_splits=kfolds, shuffle=True)

for fold, (train_ids, test_ids) in enumerate(kfold.split(dataset)):
    print(f'FOLD {fold}')
    print(train_ids, test_ids)
    train_subsampler = torch.utils.data.SubsetRandomSampler(train_ids)
    test_subsampler = torch.utils.data.SubsetRandomSampler(test_ids)
    trainloader = DataLoader(dataset, batch_size=4, sampler=train_subsampler)
    for batch_id, batch in enumerate(trainloader):
        print(type(batch))
        print(batch_id, batch[0][:,0,0,0], batch[1])
    break

FOLD 0
[ 0  1  3  4  5  6  7  8 10 11 12 13 14 15 16 17 18 19 21 22 23 24 25 26
 27 28 29 31] [ 2  9 20 30]
<class 'list'>
0 tensor([-0.4450,  0.6853,  0.8742,  1.1024]) tensor([False,  True, False, False])
<class 'list'>
1 tensor([-0.2127,  0.4061,  1.4086, -0.1292]) tensor([ True, False,  True, False])
<class 'list'>
2 tensor([0.9943, 0.2960, 1.1243, 0.5274]) tensor([False, False,  True,  True])
<class 'list'>
3 tensor([ 1.5628, -1.0033,  1.9009, -1.5863]) tensor([ True, False, False, False])
<class 'list'>
4 tensor([-0.2431,  0.5888, -0.5383, -1.6847]) tensor([False,  True,  True,  True])
<class 'list'>
5 tensor([-0.8152,  1.0058, -0.8156, -1.0477]) tensor([ True, False, False,  True])
<class 'list'>
6 tensor([-0.7050,  1.3312,  1.1899, -0.1762]) tensor([ True, False,  True, False])