code: def _range_bound(
      factor: Union[Tensor, float, Tuple[float, float], List[float]],
      name: str,
      center: Optional[float] = 0.0,
      bounds: Optional[Tuple[float, float]] = (0, float("inf")),
      check: Optional[str] = "joint",
      device: torch.device = torch.device("cpu"),
      dtype: torch.dtype = torch.get_default_dtype(),
  ) -> Tensor:
      r"""Check inputs and compute the corresponding factor bounds."""
      if not isinstance(factor, (Tensor)):
          factor = tensor(factor, device=device, dtype=dtype)
      factor_bound: Tensor
  
      if factor.dim() == 0:
          if factor < 0:
              raise ValueError(
                  f"If {name} is a single number, it must be non negative. Got {factor}."
              )
          if center is None or bounds is None:
              raise ValueError(
                  f"`center` and `bounds` cannot be None for single number. Got {center}, {bounds}."
              )
          # Should be something other than clamp
          # Currently, single value factor will not out of scope as long as the user provided it.
          # Note: I personally think throw an error will be better than a coarse clamp.
          factor_bound = (
              factor.repeat(2)
              * tensor(
                  [-1.0, 1.0], device=factor.device, dtype=factor.dtype
              )
              + center
          )
          factor_bound = factor_bound.clamp(bounds[0], bounds[1]).to(
              device=device, dtype=dtype
          )
      else:
          factor_bound = as_tensor(factor, device=device, dtype=dtype)
  
      if check is not None:
          if check == "joint":
              _joint_range_check(factor_bound, name, bounds)
          elif check == "singular":
              _singular_range_check(factor_bound, name, bounds)
          else:
              raise NotImplementedError(
                  f"methods '{check}' not implemented."
              )
  
      return factor_bound
  
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 2 for calling a global function with example usage: _range_bound(factor, name, center, bounds, check, device, dtype) and returns: factor_bound