def to_tensor(self, as_padded_sequence: bool = False) -> Union[Tensor, List[Tensor]]:
        r"""Cast :class:`Keypoints` to a tensor.

        ``mode`` controls which 2D keypoints format should be use to represent keypoints in the tensor.

        Args:
            as_padded_sequence: whether to keep the pads for a list of keypoints. This parameter is only valid
                if the keypoints are from a keypoint list.

        Returns:
            Keypoints tensor :math:`(B, N, 2)`

        """
        if as_padded_sequence:
            raise NotImplementedError
        return self._data
Cast :class:`Keypoints` to a tensor.

        ``mode`` controls which 2D keypoints format should be use to represent keypoints in the tensor.

        Args:
            as_padded_sequence: whether to keep the pads for a list of keypoints. This parameter is only valid
                if the keypoints are from a keypoint list.

        Returns:
            Keypoints tensor :math:`(B, N, 2)`

        
kornia/geometry/keypoints.py