code: def test_from_matrix(self, device, dtype, batch_size):
      matrix = torch.eye(2, device=device, dtype=dtype)
      if batch_size is not None:
          matrix = matrix.repeat(batch_size, 1, 1)
          one = torch.ones((batch_size,), device=device, dtype=dtype)
          zero = torch.zeros((batch_size,), device=device, dtype=dtype)
      else:
          one = torch.tensor(1, device=device, dtype=dtype)
          zero = torch.tensor(0, device=device, dtype=dtype)
      s = So2.from_matrix(matrix)
      self.assert_close(s.z.real, one)
      self.assert_close(s.z.imag, zero)
  
imports: import pytest
  import torch
  from kornia.geometry.liegroup import So2
  from kornia.geometry.vector import Vector2
  from kornia.testing import BaseTester
label_desc: Use image node_id 20 for calling the TestSo2 obj's underlying member method code with example usage: obj.test_from_matrix(device, dtype, batch_size) without return types