code: def test_hsv2rgb(device):
      scripted_fn = torch.jit.script(F_t._hsv2rgb)
      shape = (3, 100, 150)
      for _ in range(10):
          hsv_img = torch.rand(*shape, dtype=torch.float, device=device)
          rgb_img = F_t._hsv2rgb(hsv_img)
          ft_img = rgb_img.permute(1, 2, 0).flatten(0, 1)
  
          (
              h,
              s,
              v,
          ) = hsv_img.unbind(0)
          h = h.flatten().cpu().numpy()
          s = s.flatten().cpu().numpy()
          v = v.flatten().cpu().numpy()
  
          rgb = []
          for h1, s1, v1 in zip(h, s, v):
              rgb.append(colorsys.hsv_to_rgb(h1, s1, v1))
          colorsys_img = torch.tensor(
              rgb, dtype=torch.float32, device=device
          )
          torch.testing.assert_close(
              ft_img, colorsys_img, rtol=0.0, atol=1e-5
          )
  
          s_rgb_img = scripted_fn(hsv_img)
          torch.testing.assert_close(rgb_img, s_rgb_img)
  
      batch_tensors = _create_data_batch(
          120, 100, num_samples=4, device=device
      ).float()
      _test_fn_on_batch(batch_tensors, F_t._hsv2rgb)
  
imports: import colorsys
  import itertools
  import math
  import os
  from functools import partial
  from typing import Sequence
  import numpy
  import PIL.Image
  import pytest
  import torch
  import torchvision.transforms
  import torchvision.transforms._functional_pil
  import torchvision.transforms._functional_tensor
  import torchvision.transforms.functional
  from common_utils import _assert_approx_equal_tensor_to_pil, _assert_equal_tensor_to_pil, _create_data, _create_data_batch, _test_fn_on_batch, assert_equal, cpu_and_cuda, needs_cuda
  from torchvision.transforms import InterpolationMode
label_desc: Use image node_id 33 for calling a global function with example usage: test_hsv2rgb(device) without return types