def test_identity_batch(): C = SO3.identity(5) assert isinstance(C, SO3) \ and C.mat.dim() == 3 \ and C.mat.shape == (5, 3, 3) C_copy = SO3.identity(5, copy=True) assert isinstance(C_copy, SO3) \ and C_copy.mat.dim() == 3 \ and C_copy.mat.shape == (5, 3, 3)
def test_inv_batch(): C = SO3.exp(torch.Tensor([[1, 2, 3], [4, 5, 6]])) assert utils.allclose(C.dot(C.inv()).mat, SO3.identity(C.mat.shape[0]).mat)
def test_identity(): C = SO3.identity() assert isinstance(C, SO3) \ and C.mat.dim() == 2 \ and C.mat.shape == (3, 3)
def test_inv(): C = SO3.exp(0.25 * np.pi * torch.ones(3)) assert utils.allclose(C.dot(C.inv()).mat, SO3.identity().mat)