code: def assert_close(
      actual,
      expected,
      *,
      allow_subclasses=True,
      rtol=None,
      atol=None,
      equal_nan=False,
      check_device=True,
      check_dtype=True,
      check_layout=True,
      check_stride=False,
      msg=None,
      **kwargs,
  ):
      """Superset of :func:`torch.testing.assert_close` with support for PIL vs. tensor image comparison"""
      __tracebackhide__ = True
  
      error_metas = not_close_error_metas(
          actual,
          expected,
          pair_types=(
              NonePair,
              BooleanPair,
              NumberPair,
              ImagePair,
              TensorLikePair,
          ),
          allow_subclasses=allow_subclasses,
          rtol=rtol,
          atol=atol,
          equal_nan=equal_nan,
          check_device=check_device,
          check_dtype=check_dtype,
          check_layout=check_layout,
          check_stride=check_stride,
          **kwargs,
      )
  
      if error_metas:
          raise error_metas[0].to_error(msg)
  
imports: import contextlib
  import functools
  import itertools
  import os
  import pathlib
  import random
  import re
  import shutil
  import sys
  import tempfile
  import warnings
  from subprocess import CalledProcessError, check_output, STDOUT
  import numpy
  import PIL.Image
  import pytest
  import torch
  import torch.testing
  from PIL import Image
  from torch.testing._comparison import BooleanPair, NonePair, not_close_error_metas, NumberPair, TensorLikePair
  from torchvision import io, tv_tensors
  from torchvision.transforms._functional_tensor import _max_value
  from torchvision.transforms.v2.functional import to_image, to_pil_image
label_desc: Use image node_id 22 for calling a global function with example usage: assert_close(actual, expected) without return types