code: def test_rotation_matrix2d(batch_size, device, dtype):
      # generate input data
      center_base = torch.zeros(
          batch_size, 2, device=device, dtype=dtype
      )
      angle_base = torch.ones(batch_size, device=device, dtype=dtype)
      scale_base = torch.ones(batch_size, 2, device=device, dtype=dtype)
  
      # 90 deg rotation
      center = center_base
      angle = 90.0 * angle_base
      scale = scale_base
      M = kornia.geometry.get_rotation_matrix2d(center, angle, scale)
  
      for i in range(batch_size):
          assert_close(M[i, 0, 0].item(), 0.0, rtol=1e-4, atol=1e-4)
          assert_close(M[i, 0, 1].item(), 1.0, rtol=1e-4, atol=1e-4)
          assert_close(M[i, 1, 0].item(), -1.0, rtol=1e-4, atol=1e-4)
          assert_close(M[i, 1, 1].item(), 0.0, rtol=1e-4, atol=1e-4)
  
      # 90 deg rotation + 2x scale
      center = center_base
      angle = 90.0 * angle_base
      scale = 2.0 * scale_base
      M = kornia.geometry.get_rotation_matrix2d(center, angle, scale)
  
      for i in range(batch_size):
          assert_close(M[i, 0, 0].item(), 0.0, rtol=1e-4, atol=1e-4)
          assert_close(M[i, 0, 1].item(), 2.0, rtol=1e-4, atol=1e-4)
          assert_close(M[i, 1, 0].item(), -2.0, rtol=1e-4, atol=1e-4)
          assert_close(M[i, 1, 1].item(), 0.0, rtol=1e-4, atol=1e-4)
  
      # 45 deg rotation
      center = center_base
      angle = 45.0 * angle_base
      scale = scale_base
      M = kornia.geometry.get_rotation_matrix2d(center, angle, scale)
  
      for i in range(batch_size):
          assert_close(M[i, 0, 0].item(), 0.7071)
          assert_close(M[i, 0, 1].item(), 0.7071)
          assert_close(M[i, 1, 0].item(), -0.7071)
          assert_close(M[i, 1, 1].item(), 0.7071)
  
      # evaluate function gradient
      center = utils.tensor_to_gradcheck_var(center)  # to var
      angle = utils.tensor_to_gradcheck_var(angle)  # to var
      scale = utils.tensor_to_gradcheck_var(scale)  # to var
      assert gradcheck(
          kornia.geometry.get_rotation_matrix2d,
          (center, angle, scale),
          raise_exception=True,
          fast_mode=True,
      )
  
imports: import sys
  import pytest
  import torch
  from torch.autograd import gradcheck
  import kornia
  import kornia.testing
  from kornia.testing import assert_close
  from kornia.utils._compat import torch_version, torch_version_lt
  from kornia.utils.helpers import _torch_inverse_cast
label_desc: Use image node_id 1 for calling a global function with example usage: test_rotation_matrix2d(batch_size, device, dtype) without return types