Skip to content

Commit 3d65fc6

Browse files
authored
Clean-up delteme_all (#2249)
1 parent f8e2291 commit 3d65fc6

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

torchvision/models/detection/roi_heads.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -614,20 +614,13 @@ def add_gt_proposals(self, proposals, gt_boxes):
614614

615615
return proposals
616616

617-
def DELTEME_all(self, the_list):
618-
# type: (List[bool]) -> bool
619-
for i in the_list:
620-
if not i:
621-
return False
622-
return True
623-
624617
def check_targets(self, targets):
625618
# type: (Optional[List[Dict[str, Tensor]]]) -> None
626619
assert targets is not None
627-
assert self.DELTEME_all(["boxes" in t for t in targets])
628-
assert self.DELTEME_all(["labels" in t for t in targets])
620+
assert all(["boxes" in t for t in targets])
621+
assert all(["labels" in t for t in targets])
629622
if self.has_mask():
630-
assert self.DELTEME_all(["masks" in t for t in targets])
623+
assert all(["masks" in t for t in targets])
631624

632625
def select_training_samples(self,
633626
proposals, # type: List[Tensor]

0 commit comments

Comments
 (0)