Skip to content

Commit

Permalink
Replace dummy input index for dict feature field from 2 to 1 since 2 …
Browse files Browse the repository at this point in the history
…might not exist for data with no dictionary features (facebookresearch#438)

Summary:
Pull Request resolved: facebookresearch#438

Motivation: model trained without dictionary feature failed to export f106767664.

Reviewed By: seayoung1112

Differential Revision: D14734267

fbshipit-source-id: 28e6eff71155c9cdd8b8c0040c382b053fb5546f
  • Loading branch information
Denis Savenkov authored and facebook-github-bot committed Apr 3, 2019
1 parent e8cec67 commit 4791caa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytext/fields/dict_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class DictFeatureField(VocabUsingField):
dummy_model_input = (
torch.tensor([[2], [2]], dtype=torch.long, device="cpu"),
torch.tensor([[1], [1]], dtype=torch.long, device="cpu"),
torch.tensor([[1.5], [2.5]], dtype=torch.float, device="cpu"),
torch.tensor([1, 1], dtype=torch.long, device="cpu"),
)
Expand Down

0 comments on commit 4791caa

Please sign in to comment.