Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shape issue of return_all_hiddens in roberta #1438

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update model.py
  • Loading branch information
HMJiangGatech authored Dec 4, 2019
commit 4717d743c4e2d5d1001395b2afc8ecf81dd8be94
2 changes: 1 addition & 1 deletion fairseq/models/roberta/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def extract_features(self, src_tokens, return_all_hiddens=False, **unused):
)
features = inner_states[-1]
if return_all_hiddens:
features=features.transpose(0,1)
features = features.transpose(0,1)
return features, {'inner_states': inner_states if return_all_hiddens else None}

def output_layer(self, features, masked_tokens=None, **unused):
Expand Down