code: def allclose(tensor1: Tensor, tensor2: Tensor) -> bool:
      """Wrap torch.allclose to be robust towards dtype difference."""
      if tensor1.dtype != tensor2.dtype:
          tensor2 = tensor2.to(dtype=tensor1.dtype)
      return torch.allclose(tensor1, tensor2)
  
imports: import sys
  from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
  import torch
  from lightning_utilities import apply_to_collection
  from torch import Tensor
  from torchmetrics.utilities.exceptions import TorchMetricsUserWarning
  from torchmetrics.utilities.imports import _TORCH_GREATER_EQUAL_1_12, _TORCH_GREATER_EQUAL_1_13, _XLA_AVAILABLE
  from torchmetrics.utilities.prints import rank_zero_warn
label_desc: Use image node_id 17 for calling a global function with example usage: allclose(tensor1, tensor2) and returns: torch