Skip to content

Commit

Permalink
Update unify_transformer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
logicwong authored Jun 16, 2022
1 parent ff6ce65 commit f59bc94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/ofa/unify_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ def __init__(
image_position_idx = torch.arange(self.window_size).unsqueeze(0).expand(self.window_size, self.window_size) + \
torch.arange(self.window_size).unsqueeze(1) * image_bucket_size + 1
image_position_idx = torch.cat([torch.tensor([0]), image_position_idx.view(-1)])
image_position_idx = torch.cat([image_position_idx, torch.tensor([1024] * 768)])
image_position_idx = torch.cat([image_position_idx, torch.tensor([1024] * 769)])
self.image_rel_pos_table_list = nn.ModuleList(
[Embedding(image_num_rel_dis, self.num_attention_heads, zero_init=True) for _ in range(args.decoder_layers)]
)
Expand Down

0 comments on commit f59bc94

Please sign in to comment.