You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I solved this problem by changing this code. The solution is referred from [site1] and [site2]
Replace:
X = embed._backend.Embedding.apply(words, masked_embed_weight,
padding_idx, embed.max_norm, embed.norm_type,
embed.scale_grad_by_freq, embed.sparse
)
with:
from torch.nn import functional as F
...
X = F.embedding(
words, masked_embed_weight,
padding_idx,
embed.max_norm, embed.norm_type,
embed.scale_grad_by_freq, embed.sparse
)
In rnn/utils.py
The below code is meaning add a mask to embeding. But it run error at torch 1.12. Does anyone know to realize it at torch 1.12? Thank you!
X = embed._backend.Embedding.apply(words, masked_embed_weight,
padding_idx, embed.max_norm, embed.norm_type,
embed.scale_grad_by_freq, embed.sparse
)
The text was updated successfully, but these errors were encountered: