code: def test_write_image(self, device, tmp_path, ext, channels):
      height, width = 4, 5
      img_th: Tensor = create_random_img8_torch(
          height, width, channels, device
      )
  
      file_path = tmp_path / f"image.{ext}"
      write_image(file_path, img_th)
  
      assert file_path.is_file()
  
imports: import io
  import sys
  from pathlib import Path
  import numpy
  import pytest
  import requests
  import torch
  from kornia.core import Tensor
  from kornia.io import ImageLoadType, load_image, write_image
  from kornia.utils._compat import torch_version_ge
label_desc: Use image node_id 4 for calling the TestIoImage obj's underlying member method code with example usage: obj.test_write_image(device, tmp_path, ext, channels) without return types