Skip to content

Commit 6f5a3b7

Browse files
fix linting
1 parent 2e2ea83 commit 6f5a3b7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

torchvision/transforms/v2/_meta.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ def __init__(self, clamping_mode: CLAMPING_MODE_TYPE) -> None:
8585

8686
_transformed_types = (tv_tensors.BoundingBoxes, tv_tensors.KeyPoints)
8787

88-
def transform(self, inpt: tv_tensors.TVTensor, params: dict[str, Any]) -> tv_tensors.TVTensor:
89-
out: tv_tensors.TVTensor = inpt.clone() # type: ignore[assignment]
90-
out.clamping_mode = self.clamping_mode # type: ignore[assignment]
88+
def transform(self, inpt: tv_tensors.BoundingBoxes, params: dict[str, Any]) -> tv_tensors.BoundingBoxes:
89+
# this method works for both `tv_tensors.BoundingBoxes`` and `tv_tensors.KeyPoints`.
90+
out: tv_tensors.BoundingBoxes = inpt.clone() # type: ignore[assignment]
91+
out.clamping_mode = self.clamping_mode
9192
return out

0 commit comments

Comments
 (0)