I am trying to get familiar with PyTorch too.
One question, how do you construct your dataset or where it was donwloaded from? I refer to:

X_train_imdb_idx.npy
y_train_imdb_idx.npy
X_test_imdb_idx.npy
y_test_imdb_idx.npy