code: def check_standardization(
      Y: Tensor,
      atol_mean: float = 1e-2,
      atol_std: float = 1e-2,
      raise_on_fail: bool = False,
  ) -> None:
      r"""Check that tensor is standardized (zero mean, unit variance).
  
      Args:
          Y: The input tensor of shape `batch_shape x n x m`. Typically the
              train targets of a model. Standardization is checked across the
              `n`-dimension.
          atol_mean: The tolerance for the mean check.
          atol_std: The tolerance for the std check.
          raise_on_fail: If True, raise an exception instead of a warning.
      """
      with torch.no_grad():
          Ymean, Ystd = torch.mean(Y, dim=-2), torch.std(Y, dim=-2)
          if (
              torch.abs(Ymean).max() > atol_mean
              or torch.abs(Ystd - 1).max() > atol_std
          ):
              msg = (
                  f"Input data is not standardized (mean = {Ymean}, std = {Ystd}). "
                  "Please consider scaling the input to zero mean and unit variance."
              )
              if raise_on_fail:
                  raise InputDataError(msg)
              warnings.warn(msg, InputDataWarning)
  
imports: from __future__ import annotations
  import warnings
  from contextlib import contextmanager, ExitStack
  from typing import Iterator, List, Optional, Tuple
  import torch
  from botorch import settings
  from botorch.exceptions import InputDataError, InputDataWarning
  from botorch.settings import _Flag
  from gpytorch import settings
  from gpytorch.module import Module
  from torch import Tensor
label_desc: Use image node_id 6 for calling a global function with example usage: check_standardization(Y, atol_mean, atol_std, raise_on_fail) without return types