def quaternion_normalise(q):
    """Normalises quaternion to use as a rotation quaternion
    Args:
        q: [..., 4] quaternion
    Returns:
        q / ||q||_2
    """
    return q / q.norm(p=2,dim=-1).reshape(q.shape[0],1)