I am getting this error only during the testing phase, but I do not face any problem in the training and validation phase.

Screen Shot 2020-03-25 at 7.50.29 PM1818×292 45.8 KB

The code snippet looks like the one below,

GI6p91560×372 54.7 KB

The “lab” is a tensor value and prints out the range in such a way,
tensor([6, 7, 8])
tensor([ 9, 10, 11])
tensor([21, 22, 23])

(Note*: the length of this lab tensor can be of length ‘n’ based on the value of ElementsPerClass)