apply Black 25.11.0 style in fbcode/deeplearning/projects (21/92)
Summary: Formats the covered files with pyfmt. paintitblack Reviewed By: itamaro Differential Revision: D90476315 fbshipit-source-id: ee94c471788b8e7d067813d8b3e0311214d17f3f
This commit is contained in:
committed by
meta-codesync[bot]
parent
7b89b8fc3f
commit
11dec2936d
@@ -322,9 +322,9 @@ class TransformerEncoder(nn.Module):
|
||||
return reference_points
|
||||
|
||||
def _prepare_multilevel_features(self, srcs, masks, pos_embeds):
|
||||
assert (
|
||||
len(srcs) == self.num_feature_levels
|
||||
), "mismatch between expected and received # of feature levels"
|
||||
assert len(srcs) == self.num_feature_levels, (
|
||||
"mismatch between expected and received # of feature levels"
|
||||
)
|
||||
|
||||
src_flatten = []
|
||||
mask_flatten = []
|
||||
@@ -406,9 +406,9 @@ class TransformerEncoder(nn.Module):
|
||||
- spatial_shapes: Spatial dimensions of each feature level
|
||||
- valid_ratios: Valid ratios for each feature level
|
||||
"""
|
||||
assert (
|
||||
len(src) == self.num_feature_levels
|
||||
), "must be equal to num_feature_levels"
|
||||
assert len(src) == self.num_feature_levels, (
|
||||
"must be equal to num_feature_levels"
|
||||
)
|
||||
if src_key_padding_masks is not None:
|
||||
assert len(src_key_padding_masks) == self.num_feature_levels
|
||||
if pos is not None:
|
||||
@@ -538,9 +538,9 @@ class TransformerEncoderFusion(TransformerEncoder):
|
||||
else None
|
||||
)
|
||||
else:
|
||||
assert all(
|
||||
x.dim == 4 for x in src
|
||||
), "expected list of (bs, c, h, w) tensors"
|
||||
assert all(x.dim == 4 for x in src), (
|
||||
"expected list of (bs, c, h, w) tensors"
|
||||
)
|
||||
|
||||
if self.add_pooled_text_to_img_feat:
|
||||
# Fusion: Add mean pooled text to image features
|
||||
|
||||
Reference in New Issue
Block a user