code: def test_numpy_to_torch(numpy_data, torch_data):
      converted_data = numpy_to_torch(numpy_data)
      # Note that we compare with tolerance of 0.1 here, because due to conversion to PIL,
      # values are not exactly preserved.
      assert torch.allclose(
          converted_data[0][0], torch_data[0][0], atol=0.1
      )
      assert converted_data[0][1] == torch_data[0][1]
  
      resized_converted_data = numpy_to_torch(
          numpy_data,
          resize=256,
          crop=224,
          mean=[0.1, 0.1, 0.1],
          std=[0.1, 0.1, 0.1],
      )
      assert resized_converted_data[0][0].shape[1] == 224
      assert resized_converted_data[0][0].shape[2] == 224
  
file_path: traintool/tests/image_classification/test_preprocessing.py
imports: import comet_ml
  import pytest
  import numpy
  import torch
  from conftest import create_dataset, create_image
  from traintool.image_classification.preprocessing import recognize_data_format, torch_to_numpy, numpy_to_torch, files_to_numpy, files_to_torch, load_image, recognize_image_format, get_num_classes
label_desc: Use image node_id 10 for calling a global function with example usage: test_numpy_to_torch(numpy_data, torch_data) without return types