code: def _compute_translation_matrix(
      translation: torch.Tensor,
  ) -> torch.Tensor:
      """Compute affine matrix for translation."""
      matrix: torch.Tensor = eye_like(
          3, translation, shared_memory=False
      )
  
      dx, dy = torch.chunk(translation, chunks=2, dim=-1)
      matrix[..., 0, 2:3] += dx
      matrix[..., 1, 2:3] += dy
      return matrix
  
imports: from typing import Optional, Tuple, Union
  import torch
  from torch import nn
  from kornia.core import ones, ones_like, zeros
  from kornia.filters import gaussian_blur2d
  from kornia.utils import _extract_device_dtype
  from kornia.utils.image import perform_keep_shape_image
  from kornia.utils.misc import eye_like
  from .imgwarp import get_affine_matrix2d, get_projective_transform, get_rotation_matrix2d, warp_affine, warp_affine3d
label_desc: Use image node_id 5 for calling a global function with example usage: _compute_translation_matrix(translation) and returns: matrix