class_docstr: Class to represent a named pose between two frames.
  
  Internally represented by either Se2 or Se3.
  
  Example:
      >>> b_from_a = NamedPose(Se3.identity(), frame_src="frame_a", frame_dst="frame_b")
      >>> b_from_a
      NamedPose(dst_from_src=rotation: Parameter containing:
      tensor([1., 0., 0., 0.], requires_grad=True)
      translation: x: 0.0
      y: 0.0
      z: 0.0,
      frame_src: frame_a -> frame_dst: frame_b)
class_docstr_tok: ["Class","to","represent","a","named","pose","between","two","frames",".","Internally","represented","by","either","Se2","or","Se3",".","Example",":",">",">",">","b_from_a","=","NamedPose","(","Se3.identity","(",")",",","frame_src=","''","frame_a","''",",","frame_dst=","''","frame_b","''",")",">",">",">","b_from_a","NamedPose","(","dst_from_src=rotation",":","Parameter","containing",":","tensor","(","[","1.",",","0.",",","0.",",","0",".","]",",","requires_grad=True",")","translation",":","x",":","0.0","y",":","0.0","z",":","0.0",",","frame_src",":","frame_a","-",">","frame_dst",":","frame_b",")"]
docstr: Construct NamedPose from a matrix.
  
  Args:
      matrix: Matrix representation of the pose.
      frame_src: Name of the source frame.
      frame_dst: Name of the destination frame.
  
  Returns:
      NamedPose constructed from a matrix.
  
  Example:
      >>> b_from_a_matrix = Se3.identity().matrix()
      >>> b_from_a = NamedPose.from_matrix(b_from_a_matrix, frame_src="frame_a", frame_dst="frame_b")
      >>> b_from_a
      NamedPose(dst_from_src=rotation: Parameter containing:
      tensor([1., 0., 0., 0.], requires_grad=True)
      translation: Parameter containing:
      tensor([0., 0., 0.], requires_grad=True),
      frame_src: frame_a -> frame_dst: frame_b)
docstr_tok: ["Construct","NamedPose","from","a","matrix",".","Args",":","matrix",":","Matrix","representation","of","the","pose",".","frame_src",":","Name","of","the","source","frame",".","frame_dst",":","Name","of","the","destination","frame",".","Returns",":","NamedPose","constructed","from","a","matrix",".","Example",":",">",">",">","b_from_a_matrix","=","Se3.identity","(",")",".matrix","(",")",">",">",">","b_from_a","=","NamedPose.from_matrix","(","b_from_a_matrix",",","frame_src=","''","frame_a","''",",","frame_dst=","''","frame_b","''",")",">",">",">","b_from_a","NamedPose","(","dst_from_src=rotation",":","Parameter","containing",":","tensor","(","[","1.",",","0.",",","0.",",","0",".","]",",","requires_grad=True",")","translation",":","Parameter","containing",":","tensor","(","[","0.",",","0.",",","0",".","]",",","requires_grad=True",")",",","frame_src",":","frame_a","-",">","frame_dst",":","frame_b",")"]
code: def from_matrix(
      cls,
      matrix: Tensor,
      frame_src: str | None = None,
      frame_dst: str | None = None,
  ) -> NamedPose | None:
      """Construct NamedPose from a matrix.
  
      Args:
          matrix: Matrix representation of the pose.
          frame_src: Name of the source frame.
          frame_dst: Name of the destination frame.
  
      Returns:
          NamedPose constructed from a matrix.
  
      Example:
          >>> b_from_a_matrix = Se3.identity().matrix()
          >>> b_from_a = NamedPose.from_matrix(b_from_a_matrix, frame_src="frame_a", frame_dst="frame_b")
          >>> b_from_a
          NamedPose(dst_from_src=rotation: Parameter containing:
          tensor([1., 0., 0., 0.], requires_grad=True)
          translation: Parameter containing:
          tensor([0., 0., 0.], requires_grad=True),
          frame_src: frame_a -> frame_dst: frame_b)
      """
      check_matrix_shape(matrix, matrix_type="RT")
      dim = matrix.shape[-1]
      if dim == 3:
          return cls(Se2.from_matrix(matrix), frame_src, frame_dst)
      elif dim == 4:
          return cls(Se3.from_matrix(matrix), frame_src, frame_dst)
      return None
  
file_path: kornia/kornia/geometry/pose.py
imports: from __future__ import annotations
  import uuid
  from kornia.core import Tensor, eye
  from kornia.geometry.liegroup import Se2, Se3, So2, So3
  from kornia.geometry.quaternion import Quaternion
label_desc: Use image node_id 10 for calling the NamedPose obj's underlying member method code with example usage: obj.from_matrix(cls, matrix, frame_src, frame_dst) and returns: None, cls, cls