Natural_Language_Processing_with_Transformers icon indicating copy to clipboard operation
Natural_Language_Processing_with_Transformers copied to clipboard

Code Error

Open awei-lwj opened this issue 1 year ago • 1 comments

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])


awei-lwj avatar Feb 25 '24 07:02 awei-lwj

be54277b278d5044ad6e3d9e3ef0fe323f838fd1

KevinZonda avatar Apr 05 '24 00:04 KevinZonda

Thanks. Has been merged.

znsoftm avatar Apr 25 '24 10:04 znsoftm

@znsoftm Hi, should close this issue

KevinZonda avatar Apr 25 '24 14:04 KevinZonda