Hi @ptrblck, I understand what are you trying to say but I am having an issue with that.

This was just a batch for testing the model if it works or not. The highest value in that batch was 53 while my vocab(token_2_id) size is 56. What if another batch comes up with the highest value other than 53, what will happen then? How will I resolve that problem?

Can you please guide me through this?
print(torch.max(names_id_tensor))
print(torch.min(names_id_tensor))

Output
tensor(53)
tensor(1)