code: def test_fill_padding_translation(self, device, dtype):
      offset = 1.0
      h, w = 3, 4
      aff_ab = torch.eye(2, 3, device=device, dtype=dtype)[None]
      aff_ab[..., -1] += offset
  
      img_b = torch.arange(
          float(3 * h * w), device=device, dtype=dtype
      ).view(1, 3, h, w)
  
      # normally fill_value will also be converted to the right device and type in warp_affine
      fill_value = torch.tensor(
          [0.5, 0.2, 0.1], device=device, dtype=dtype
      )
  
      img_a = kornia.geometry.warp_affine(
          img_b,
          aff_ab,
          (h, w),
          padding_mode="fill",
          fill_value=fill_value,
      )
      top_row_mean = img_a[..., :1, :].mean(dim=[0, 2, 3])
      first_col_mean = img_a[..., :1].mean(dim=[0, 2, 3])
      assert_close(top_row_mean, fill_value)
      assert_close(first_col_mean, fill_value)
  
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 8 for calling the TestWarpAffine obj's underlying member method code with example usage: obj.test_fill_padding_translation(device, dtype) without return types