Skip to content

Fix padding_idx getting ignored in backward for Embedding(sparse=True)#3842

Merged
soumith merged 1 commit intopytorch:masterfrom
ssnl:sparse_idz
Nov 23, 2017
Merged

Fix padding_idx getting ignored in backward for Embedding(sparse=True)#3842
soumith merged 1 commit intopytorch:masterfrom
ssnl:sparse_idz

Conversation

@ssnl
Copy link
Copy Markdown
Collaborator

@ssnl ssnl commented Nov 22, 2017

Fixes #3506

Verified that gradients are identical for sparse and dense in Embedding(padding_idx=(not None), sparse=True) with same weight matrix.

@ssnl ssnl changed the title Fix padding_idx ignored in backward for Embedding(sparse=True) Fix padding_idx getting ignored in backward for Embedding(sparse=True) Nov 22, 2017
@soumith soumith merged commit 6dc1fc7 into pytorch:master Nov 23, 2017
@ssnl ssnl deleted the sparse_idz branch November 23, 2017 03:08
@soumith soumith added the 0.3.1 label Feb 4, 2018
soumith pushed a commit that referenced this pull request Feb 7, 2018
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nn.Embedding with sparse=True ignores padding_idx

3 participants