Natural_Language_Processing_with_Transformers
Natural_Language_Processing_with_Transformers copied to clipboard
Code Error
In the chapter02
import torch import torch.nn.functional as F
input_ids = torch.tensor(input_ids)
one_hot_encodings = F.one_hot(input_ids, num_classes=len(token2idx))
one_hot_encodings.shape
torch.Size([38, 20])
be54277b278d5044ad6e3d9e3ef0fe323f838fd1
Thanks. Has been merged.
@znsoftm Hi, should close this issue