Skip to content

Commit f03f958

Browse files
committed
Align signatures
1 parent 08e8843 commit f03f958

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

torchvision/tv_tensors/_keypoints.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ def __new__(
4747
data: Any,
4848
*,
4949
canvas_size: tuple[int, int],
50-
dtype: Optional[torch.dtype] = None,
51-
device: Optional[Union[torch.device, str, int]] = None,
52-
requires_grad: Optional[bool] = None,
53-
):
50+
dtype: torch.dtype | None = None,
51+
device: torch.device | str | int | None = None,
52+
requires_grad: bool | None = None,
53+
) -> KeyPoints:
5454
tensor: torch.Tensor = cls._to_tensor(data, dtype=dtype, device=device, requires_grad=requires_grad)
5555
if tensor.ndim == 1:
5656
tensor = tensor.unsqueeze(0)
@@ -63,10 +63,10 @@ def __new__(
6363
@classmethod
6464
def _wrap_output(
6565
cls,
66-
output: Any,
66+
output: torch.Tensor,
6767
args: Sequence[Any] = (),
68-
kwargs: Optional[Mapping[str, Any]] = None,
69-
) -> Any:
68+
kwargs: Mapping[str, Any] | None = None,
69+
) -> KeyPoints:
7070
# Mostly copied over from the BoundingBoxes TVTensor, minor improvements.
7171
# This copies over the metadata.
7272
# For BoundingBoxes, that included format, but we only support one format here !

0 commit comments

Comments
 (0)