code: def check_tau(tau: FloatOrTensor, name: str) -> FloatOrTensor:
      """Checks the validity of the tau arguments of the functions below, and returns
      `tau` if it is valid."""
      if isinstance(tau, Tensor) and tau.numel() != 1:
          raise ValueError(
              name + f" is not a scalar: {tau.numel() = }."
          )
      if not (tau > 0):
          raise ValueError(name + f" is non-positive: {tau = }.")
      return tau
  
imports: from __future__ import annotations
  from copy import deepcopy
  from functools import partial
  from typing import Any, Callable, List, Optional, Tuple, TypeVar, Union
  import torch
  from botorch.acquisition.cached_cholesky import CachedCholeskyMCSamplerMixin
  from botorch.acquisition.monte_carlo import SampleReducingMCAcquisitionFunction
  from botorch.acquisition.objective import ConstrainedMCObjective, MCAcquisitionObjective, PosteriorTransform
  from botorch.acquisition.utils import compute_best_feasible_objective, prune_inferior_points
  from botorch.exceptions.errors import BotorchError
  from botorch.models.model import Model
  from botorch.sampling.base import MCSampler
  from botorch.utils.safe_math import fatmax, log_fatplus, log_softplus, logmeanexp, smooth_amax
  from botorch.utils.transforms import match_batch_shape
  from torch import Tensor
label_desc: Use image node_id 2 for calling a global function with example usage: check_tau(tau, name) and returns: tau