Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Fix ordering of text field embedders (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
OyvindTafjord authored Sep 6, 2017
1 parent 5041e69 commit 9905e1b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ def forward(self, text_field_input: Dict[str, torch.Tensor]) -> torch.Tensor:
str(text_field_input.keys()))
raise ConfigurationError(message)
embedded_representations = []
for key, tensor in text_field_input.items():
keys = sorted(text_field_input.keys())
for key in keys:
tensor = text_field_input[key]
embedder = self._token_embedders[key]
token_vectors = embedder(tensor)
embedded_representations.append(token_vectors)
Expand Down

0 comments on commit 9905e1b

Please sign in to comment.