code: def test_cardinality(self, device, dtype, input_shape):
      t_input_shape = (*input_shape, 2)
      z = torch.randn((*input_shape, 2), dtype=dtype, device=device)
      t = torch.randn(t_input_shape, dtype=dtype, device=device)
      s = Se2(So2(torch.complex(z[..., 0], z[..., 1])), t)
      theta = torch.rand((*input_shape, 3), dtype=dtype, device=device)
      assert s.so2.z.shape == input_shape
      assert s.t.shape == t_input_shape
      assert (s * s).so2.z.shape == input_shape
      assert (s * s).t.shape == t_input_shape
      assert s.exp(theta).so2.z.shape == input_shape
      assert s.exp(theta).t.shape == t_input_shape
      assert s.log().shape == (*input_shape, 3)
      if not any(input_shape):
          expected_hat_shape = (3, 3)
      else:
          expected_hat_shape = (input_shape[0], 3, 3)
      assert s.hat(theta).shape == expected_hat_shape
      assert s.inverse().so2.z.shape == input_shape
      assert s.inverse().t.shape == t_input_shape
  
imports: import pytest
  import torch
  from kornia.geometry.liegroup import Se2, So2
  from kornia.geometry.vector import Vector2
  from kornia.testing import BaseTester
label_desc: Use image node_id 3 for calling the TestSe2 obj's underlying member method code with example usage: obj.test_cardinality(device, dtype, input_shape) without return types