Unverified Commit 3d65fc67 authored by Francisco Massa's avatar Francisco Massa Committed by GitHub
Browse files

Clean-up delteme_all (#2249)

parent f8e2291d
...@@ -614,20 +614,13 @@ class RoIHeads(torch.nn.Module): ...@@ -614,20 +614,13 @@ class RoIHeads(torch.nn.Module):
return proposals return proposals
def DELTEME_all(self, the_list):
# type: (List[bool]) -> bool
for i in the_list:
if not i:
return False
return True
def check_targets(self, targets): def check_targets(self, targets):
# type: (Optional[List[Dict[str, Tensor]]]) -> None # type: (Optional[List[Dict[str, Tensor]]]) -> None
assert targets is not None assert targets is not None
assert self.DELTEME_all(["boxes" in t for t in targets]) assert all(["boxes" in t for t in targets])
assert self.DELTEME_all(["labels" in t for t in targets]) assert all(["labels" in t for t in targets])
if self.has_mask(): if self.has_mask():
assert self.DELTEME_all(["masks" in t for t in targets]) assert all(["masks" in t for t in targets])
def select_training_samples(self, def select_training_samples(self,
proposals, # type: List[Tensor] proposals, # type: List[Tensor]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment