Skip to content

Commit

Permalink
Make style
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsRogge committed Jun 8, 2021
1 parent 731297d commit dcbd458
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@


import argparse
from pathlib import Path
from collections import OrderedDict
from pathlib import Path

import torch
from PIL import Image
Expand Down Expand Up @@ -120,7 +120,7 @@ def rename_backbone_keys(state_dict):
new_state_dict[new_key] = value
else:
new_state_dict[key] = value

return new_state_dict


Expand Down
3 changes: 1 addition & 2 deletions src/transformers/models/detr/modeling_detr.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ def forward(self, pixel_values: torch.Tensor, pixel_mask: torch.Tensor):
return out



class DetrConvModel(nn.Module):
"""
This module adds 2D position embeddings to all intermediate feature maps of the convolutional encoder.
Expand All @@ -387,7 +386,7 @@ def forward(self, pixel_values, pixel_mask):
pos.append(self.position_embedding(feature_map, mask).to(feature_map.dtype))

return out, pos


def _expand_mask(mask: torch.Tensor, dtype: torch.dtype, tgt_len: Optional[int] = None):
"""
Expand Down

0 comments on commit dcbd458

Please sign in to comment.