code: def test_numpy(self, device):
      # as it was from cv2.imread
      data = np.ones((4, 5, 3), dtype=np.uint8)
      img = Image.from_numpy(data, color_space=ColorSpace.RGB)
      img = img.to(device)
      assert isinstance(img, Image)
      assert img.channels == 3
      assert img.height == 4
      assert img.width == 5
      assert img.pixel_format.color_space == ColorSpace.RGB
      assert img.shape == (4, 5, 3)
      assert img.device == device
      assert img.dtype == torch.uint8
      assert_close(data, img.to_numpy())
  
      # check clone
      img2 = img.clone()
      assert isinstance(img2, Image)
      img2 = img2.to(device)
      assert img2.dtype == torch.uint8
      assert img2.device == device
      img3 = img2.to(torch.uint8)
      assert isinstance(img3, Image)
      assert img3.dtype == torch.uint8
      assert img3.device == device
  
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 2 for calling the TestImage obj's underlying member method code with example usage: obj.test_numpy(device) without return types