code: def _singular_range_check(
      ranged_factor: Tensor,
      name: str,
      bounds: Optional[Tuple[float, float]] = None,
      skip_none: bool = False,
      mode: str = "2d",
  ) -> None:
      """Check if bounds[0] <= ranged_factor[0] <= bounds[1] and bounds[0] <= ranged_factor[1] <= bounds[1]"""
      if mode == "2d":
          dim_size = 2
      elif mode == "3d":
          dim_size = 3
      else:
          raise ValueError(
              f"'mode' shall be either 2d or 3d. Got {mode}"
          )
  
      if skip_none and ranged_factor is None:
          return
      if bounds is None:
          bounds = (float("-inf"), float("inf"))
      if ranged_factor.dim() == 1 and len(ranged_factor) == dim_size:
          for f in ranged_factor:
              if not bounds[0] <= f <= bounds[1]:
                  raise ValueError(
                      f"{name} out of bounds. Expected inside {bounds}, got {ranged_factor}."
                  )
      else:
          raise TypeError(
              f"{name} should be a float number or a tuple with length {dim_size} whose values between {bounds}."
              f"Got {ranged_factor}"
          )
  
file_path: kornia/kornia/augmentation/utils/param_validation.py
imports: from typing import Any, List, Optional, Tuple, Union
  import torch
  from kornia.core import Tensor, as_tensor, tensor
label_desc: Use image node_id 4 for calling a global function with example usage: _singular_range_check(ranged_factor, name, bounds, skip_none, mode) without return types