Docs : Introduction Guide, test_dataloader wrong sequence length in random_split
Docs : Introduction Guide, test_dataloader
For the MNIST dataset, The training set contains 60000 examples, and the test set 10000 examples.
while creating the test_dataloader, in the code
mnist_train = MNIST(os.getcwd(), train=False, download=False, transform=transform)

the train is set to false, so it reads from the test set which only has 10000 examples, hence the next step causes it to fail as we make a split of 55k & 5k examples.
_, mnist_val = random_split(mnist_train, [55000, 5000])

with error
ValueError: Sum of input lengths does not equal the length of the input dataset!

best way to resolve it would be to remove the random_split call & return the complete test data from the test_dataloadet