original_docstring: 
      Convert rotation matrices to quaternions. It ensures that there's no switch to the antipodal representation
      within this sequence of rotations.
      Args:
          oris: np array of shape (seq_length, n_joints*9).
      Returns: np array of shape (seq_length, n_joints*4)
      
docstring: Convert rotation matrices to quaternions. It ensures that there's no switch to the antipodal representation
  within this sequence of rotations.
docstring_tokens: Convert rotation matrices to quaternions . It ensures that there ' s no switch to the antipodal representation within this sequence of rotations .
code: def rotmat2quat(rotmats):
      """
      Convert rotation matrices to quaternions. It ensures that there's no switch to the antipodal representation
      within this sequence of rotations.
      Args:
          oris: np array of shape (seq_length, n_joints*9).
      Returns: np array of shape (seq_length, n_joints*4)
      """
      seq_length = rotmats.shape[0]
      assert rotmats.shape[1] % 9 == 0
      ori = np.reshape(rotmats, [seq_length, -1, 3, 3])
      ori_q = quaternion.as_float_array(quaternion.from_rotation_matrix(ori))
      ori_qc = correct_antipodal_quaternions(ori_q)
      ori_qc = np.reshape(ori_qc, [seq_length, -1])
      return ori_qc
code_tokens: def rotmat2quat ( rotmats ) : seq_length = rotmats . shape [ 0 ] assert rotmats . shape [ 1 ] % 9 == 0 ori = np . reshape ( rotmats , [ seq_length , - 1 , 3 , 3 ] ) ori_q = quaternion . as_float_array ( quaternion . from_rotation_matrix ( ori ) ) ori_qc = correct_antipodal_quaternions ( ori_q ) ori_qc = np . reshape ( ori_qc , [ seq_length , - 1 ] ) return ori_qc
short_docstring: Convert rotation matrices to quaternions.
short_docstring_tokens: Convert rotation matrices to quaternions .
comment: """
      Convert rotation matrices to quaternions. It ensures that there's no switch to the antipodal representation
      within this sequence of rotations.
      Args:
          oris: np array of shape (seq_length, n_joints*9).
      Returns: np array of shape (seq_length, n_joints*4)
      """