While generating predictions for my trained RNN model, I was getting the

too many values to unpack (expected 2)

error. Which got resolved using .item() function. However, after resolving the above error now I am getting this  error.

only one element tensors can be converted to Python scalars

My prediction_loader instance consist of training data having the labels and training set.
labels are denoted by batch_y and training set as batch_x
Code and error snippets:

image971×754 34.8 KB