code: def test_load_write(self, tmp_path: Path) -> None:
      data = torch.randint(0, 255, (3, 4, 5), dtype=torch.uint8)
      img = Image.from_numpy(
          data.numpy(), channels_order=ChannelsOrder.CHANNELS_FIRST
      )
  
      file_name = tmp_path / "image.jpg"
  
      img.write(file_name)
      img2 = Image.from_file(file_name)
  
      # NOTE: the tolerance is high due to the jpeg compression
      assert (img.float().data - img2.float().data).pow(
          2
      ).mean() <= 0.75
  
file_path: kornia/test/image/test_image.py
imports: from pathlib import Path
  import numpy
  import pytest
  import torch
  from kornia.image.base import ChannelsOrder, ColorSpace, ImageLayout, ImageSize, PixelFormat
  from kornia.image.image import Image
  from kornia.testing import assert_close
  from kornia.utils._compat import torch_version_le
label_desc: Use image node_id 4 for calling the TestImage obj's underlying member method code with example usage: obj.test_load_write(tmp_path) without return types