code: def test_to_tensor_returns_correct_type():
      """`to_tensor` flag should ensure that pre-processor returns the expected
      type."""
      image = skimage.data.astronaut()
  
      pre_processor = get_transforms(
          config=None, image_size=256, to_tensor=True
      )
      transformed = pre_processor(image=image)["image"]
      assert isinstance(transformed, Tensor)
  
      pre_processor = get_transforms(
          config=None, image_size=256, to_tensor=False
      )
      transformed = pre_processor(image=image)["image"]
      assert isinstance(transformed, np.ndarray)
  
file_path: anomalib/tests/pre_merge/pre_processing/transforms/test_transforms.py
imports: import tempfile
  import albumentations
  import numpy
  import pytest
  import skimage
  from torch import Tensor
  from anomalib.data.utils import get_transforms
label_desc: Use image node_id 7 for calling a global function with example usage: test_to_tensor_returns_correct_type() without return types