Hmm, I’m not able to replicate this. The following prints True for me -
img = next(iter(test_dl))[0]

fit(1, model, opt, loss_fn, train_dl, valid_dl, metric)
_, feature1 = model(img.cuda())
fit(1, model, opt, loss_fn, train_dl, valid_dl, metric)
_, feature2 = model(img.cuda())

print(torch.allclose(feature1, feature2))