Commit 99c524c5 authored by Myle Ott's avatar Myle Ott Committed by Facebook Github Bot
Browse files

Fix fairspeq unit test

Summary: Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/897

Differential Revision: D18250587

Pulled By: myleott

fbshipit-source-id: b9cef376bc014b68766229aab7b6e454480757d3
parent f30fc7d7
...@@ -63,9 +63,12 @@ class MultiheadAttention(nn.Module): ...@@ -63,9 +63,12 @@ class MultiheadAttention(nn.Module):
else: else:
self.enable_torch_version = False self.enable_torch_version = False
@property
def in_proj_weight(self):
return torch.cat((self.q_proj.weight, self.k_proj.weight, self.v_proj.weight))
@property @property
def in_proj_bias(self): def in_proj_bias(self):
# TODO: Remove this backward compatibility code (in_proj_bias)
return torch.cat((self.q_proj.bias, self.k_proj.bias, self.v_proj.bias)) return torch.cat((self.q_proj.bias, self.k_proj.bias, self.v_proj.bias))
def prepare_for_onnx_export_(self): def prepare_for_onnx_export_(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment