def rot_to_quat(rot):
 rot = rot.reshape((rot.shape[:(-2)] + (9,)))
 return np.apply_along_axis(_one_rot_to_quat, (-1), rot)

def rot_to_quat ( rot ) : rot = rot . reshape ( ( rot . shape [ : ( - 2 ) ] + ( 9 , ) ) ) return np . apply_along_axis ( _one_rot_to_quat , ( - 1 ) , rot )
convert a set of rotations to quaternions .