code: def test_warp_grid_offset_x1_depth1(self, batch_size, device, dtype):
      height, width = 3, 5  # output shape
      pinhole_src, pinhole_dst = self._create_pinhole_pair(
          batch_size, device, dtype
      )
      pinhole_dst.tx += 1.0  # apply offset to tx
  
      # initialize depth to one
      depth_src = torch.ones(
          batch_size, 1, height, width, device=device, dtype=dtype
      )
  
      # create warper, initialize projection matrices and warp grid
      warper = kornia.geometry.depth.DepthWarper(
          pinhole_dst, height, width
      )
      warper.compute_projection_matrix(pinhole_src)
  
      grid_warped = warper.warp_grid(depth_src)
      assert grid_warped.shape == (batch_size, height, width, 2)
  
      # normalize base meshgrid
      grid = warper.grid[..., :2].to(device=device, dtype=dtype)
      grid_norm = normalize_pixel_coordinates(grid, height, width)
  
      # check offset in x-axis
      assert_close(
          grid_warped[..., -2, 0],
          grid_norm[..., -1, 0].repeat(batch_size, 1),
          atol=1e-4,
          rtol=1e-4,
      )
      # check that y-axis remain the same
      assert_close(
          grid_warped[..., -1, 1],
          grid_norm[..., -1, 1].repeat(batch_size, 1),
          rtol=1e-4,
          atol=1e-4,
      )
  
file_path: kornia/test/geometry/test_depth_warper.py
imports: import pytest
  import torch
  from torch.autograd import gradcheck
  import kornia
  import kornia.testing
  from kornia.geometry.conversions import normalize_pixel_coordinates
  from kornia.testing import assert_close
label_desc: Use image node_id 3 for calling the TestDepthWarper obj's underlying member method code with example usage: obj.test_warp_grid_offset_x1_depth1(batch_size, device, dtype) without return types