mirror of
https://github.com/facebookresearch/fairseq.git
synced 2024-11-11 03:31:32 +03:00
parent
66d713b4d0
commit
05625e3e6e
@ -97,7 +97,7 @@ class SinusoidalPositionalEmbedding(nn.Module):
|
||||
if self.onnx_trace:
|
||||
flat_embeddings = self.weights.detach().index_select(0, positions.view(-1))
|
||||
embedding_shape = torch.cat(
|
||||
(bsz.view(1), seq_len.view(1), torch.tensor([-1], dtype=torch.long))
|
||||
(bsz, seq_len, torch.tensor([-1], dtype=torch.long))
|
||||
)
|
||||
embeddings = torch.onnx.operators.reshape_from_tensor_shape(
|
||||
flat_embeddings, embedding_shape
|
||||
|
Loading…
Reference in New Issue
Block a user