code: def test_identity_map(self, device, height, width, dt):
      # Tests on square and rectangular images
      tensor, pil_img = _create_data(height, width, device=device)
  
      if dt == torch.float16 and device == "cpu":
          # skip float16 on CPU case
          return
  
      if dt is not None:
          tensor = tensor.to(dtype=dt)
  
      # 1) identity map
      out_tensor = F.affine(
          tensor,
          angle=0,
          translate=[0, 0],
          scale=1.0,
          shear=[0.0, 0.0],
          interpolation=NEAREST,
      )
  
      assert_equal(
          tensor,
          out_tensor,
          msg=f"{out_tensor[0, :5, :5]} vs {tensor[0, :5, :5]}",
      )
      out_tensor = self.scripted_affine(
          tensor,
          angle=0,
          translate=[0, 0],
          scale=1.0,
          shear=[0.0, 0.0],
          interpolation=NEAREST,
      )
      assert_equal(
          tensor,
          out_tensor,
          msg=f"{out_tensor[0, :5, :5]} vs {tensor[0, :5, :5]}",
      )
  
imports: import colorsys
  import itertools
  import math
  import os
  from functools import partial
  from typing import Sequence
  import numpy
  import PIL.Image
  import pytest
  import torch
  import torchvision.transforms
  import torchvision.transforms._functional_pil
  import torchvision.transforms._functional_tensor
  import torchvision.transforms.functional
  from common_utils import _assert_approx_equal_tensor_to_pil, _assert_equal_tensor_to_pil, _create_data, _create_data_batch, _test_fn_on_batch, assert_equal, cpu_and_cuda, needs_cuda
  from torchvision.transforms import InterpolationMode
label_desc: Use image node_id 1 for calling the TestAffine obj's underlying member method code with example usage: obj.test_identity_map(device, height, width, dt) without return types