-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Description
Hi. There is no zero padding:
import torch
from torch.autograd import Variable
import torch.nn as nn
e = nn.Embedding(3, 2, padding_idx=0)
e.weight = nn.Parameter(torch.rand(3, 2))
print(e.weight)
Output:
Parameter containing:
0.5051 0.5076
0.9464 0.2811
0.4968 0.2109
[torch.FloatTensor of size 3x2]
indices = Variable(torch.LongTensor([0, 1, 2]))
e(indices)
Output:
Variable containing:
0.5051 0.5076
0.9464 0.2811
0.4968 0.2109
[torch.FloatTensor of size 3x2]
pytorch version: 0.1.12
EmreOzkose
Metadata
Metadata
Assignees
Labels
No labels