Skip to content

Commit

Permalink
code adaptation/changes according to the commits on Oct 17, 2022
Browse files Browse the repository at this point in the history
  • Loading branch information
freewym committed Oct 18, 2022
1 parent 060f04f commit 227ec47
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions espresso/modules/sinusoidal_relative_positional_embedding.py
Expand Up @@ -87,12 +87,7 @@ def forward(
relative posotional embedding for key of shape `(batch_size, 2*seq_len-1, embed_dim)`,
where `seq_len` is the length of key
"""
if torch.jit.is_scripting():
bspair = torch.onnx.operators.shape_as_tensor(input)
elif torch.onnx.is_in_onnx_export():
bspair = torch.onnx.operators.shape_as_tensor(input)
else:
bspair = input.size()
bspair = torch.onnx.operators.shape_as_tensor(input)
bsz, seq_len = bspair[0], bspair[1]
max_positions = self.weight.size(0)
if self.padding_idx is not None:
Expand Down

0 comments on commit 227ec47

Please sign in to comment.