code: def test_convert_image_dtype(device, in_dtype, out_dtype):
      tensor, _ = _create_data(26, 34, device=device)
      batch_tensors = torch.rand(4, 3, 44, 56, device=device)
  
      in_tensor = tensor.to(in_dtype)
      in_batch_tensors = batch_tensors.to(in_dtype)
  
      fn = T.ConvertImageDtype(dtype=out_dtype)
      scripted_fn = torch.jit.script(fn)
  
      if (
          in_dtype == torch.float32
          and out_dtype in (torch.int32, torch.int64)
      ) or (in_dtype == torch.float64 and out_dtype == torch.int64):
          with pytest.raises(
              RuntimeError, match=r"cannot be performed safely"
          ):
              _test_transform_vs_scripted(fn, scripted_fn, in_tensor)
          with pytest.raises(
              RuntimeError, match=r"cannot be performed safely"
          ):
              _test_transform_vs_scripted_on_batch(
                  fn, scripted_fn, in_batch_tensors
              )
          return
  
      _test_transform_vs_scripted(fn, scripted_fn, in_tensor)
      _test_transform_vs_scripted_on_batch(
          fn, scripted_fn, in_batch_tensors
      )
  
imports: import os
  import sys
  import numpy
  import PIL.Image
  import pytest
  import torch
  from common_utils import _assert_approx_equal_tensor_to_pil, _assert_equal_tensor_to_pil, _create_data, _create_data_batch, assert_equal, cpu_and_cuda, float_dtypes, get_tmp_dir, int_dtypes
  from torchvision import transforms
  from torchvision.transforms import functional, InterpolationMode
  from torchvision.transforms.autoaugment import _apply_op
label_desc: Use image node_id 28 for calling a global function with example usage: test_convert_image_dtype(device, in_dtype, out_dtype) without return types