Could you check the dtype as well as the min and max value of a data sample using your custom CIFAR10 dataset?
I suspect that based on the dtype some transformations will work differently (e.g. ToTensor).