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