Skip to content

Commit

Permalink
Made targets argument in YOLOTransform.forward() truly optional. (#108)
Browse files Browse the repository at this point in the history
`targets` was missing a default value of `None` making using YOLOTransform on its own require explicitly passing `None` during inference.
  • Loading branch information
dkloving authored May 19, 2021
1 parent 29de21f commit 97c8ab7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yolort/models/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(self, min_size, max_size) -> None:
def forward(
self,
images: List[Tensor],
targets: Optional[List[Dict[str, Tensor]]],
targets: Optional[List[Dict[str, Tensor]]] = None,
) -> Tuple[NestedTensor, Optional[Tensor]]:
device = images[0].device
images = [img for img in images]
Expand Down

0 comments on commit 97c8ab7

Please sign in to comment.