code: def _test_class_op(
      transform_cls,
      device,
      channels=3,
      meth_kwargs=None,
      test_exact_match=True,
      **match_kwargs,
  ):
      meth_kwargs = meth_kwargs or {}
  
      # test for class interface
      f = transform_cls(**meth_kwargs)
      scripted_fn = torch.jit.script(f)
  
      tensor, pil_img = _create_data(26, 34, channels, device=device)
      # set seed to reproduce the same transformation for tensor and PIL image
      torch.manual_seed(12)
      transformed_tensor = f(tensor)
      torch.manual_seed(12)
      transformed_pil_img = f(pil_img)
      if test_exact_match:
          _assert_equal_tensor_to_pil(
              transformed_tensor, transformed_pil_img, **match_kwargs
          )
      else:
          _assert_approx_equal_tensor_to_pil(
              transformed_tensor.float(),
              transformed_pil_img,
              **match_kwargs,
          )
  
      torch.manual_seed(12)
      transformed_tensor_script = scripted_fn(tensor)
      assert_equal(transformed_tensor, transformed_tensor_script)
  
      batch_tensors = _create_data_batch(
          height=23,
          width=34,
          channels=channels,
          num_samples=4,
          device=device,
      )
      _test_transform_vs_scripted_on_batch(
          f, scripted_fn, batch_tensors
      )
  
      with get_tmp_dir() as tmp_dir:
          scripted_fn.save(
              os.path.join(tmp_dir, f"t_{transform_cls.__name__}.pt")
          )
  
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 4 for calling a global function with example usage: _test_class_op(transform_cls, device, channels, meth_kwargs, test_exact_match) without return types