# 초기 임베딩 설정을 위한 코드 예시 emb = nn.Embedding(3, 5, padding_idx = 0) pre_emb = np.random.rand(2, 5) with torch.no_grad(): for idx in range(len(pre_emb)): emb.weight[idx + 1] = torch.tensor(pre_emb[idx])