class_docstr: 2D Keypoints containing Nx2 or BxNx2 points.
  
  Args:
      keypoints: Raw tensor or a list of Tensors with the Nx2 coordinates
      raise_if_not_floating_point: will raise if the Tensor isn't float
docstr: 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)`
docstr_tok: ["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",")","`"]
code: 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
  
imports: from typing import List, Optional, Tuple, Union, cast
  import torch
  from torch import Size
  from kornia.core import Tensor
  from kornia.geometry import transform_points
label_desc: Use image node_id 14 for calling the Keypoints obj's underlying member method code with example usage: obj.to_tensor(as_padded_sequence) and returns: self