Could you print the min and max values of names_id_tensor?
The embedding_dim is currently set as self.input_size, which is the length of token_2_id.
Note that the embedding dimension refers to the max. input index you would like to provide.