code: def _add_cuda_warning(func):
      # docstr-coverage: excused `wrapped`
      @functools.wraps(func)
      def wrapped(*args, **kwargs):
          try:
              return func(*args, **kwargs)
          except RuntimeError as e:
              if not is_cudnn_error(e):
                  raise e
              raise RuntimeError(
                  "\nThis code crash might have been caused by a CUDA bug, see "
                  "https://github.com/allenai/allennlp/issues/2888, "
                  "which causes the code to crash during evaluation mode.\n"
                  "To avoid this error, the batch size has to be reduced.",
              ) from e
  
      return wrapped
  
imports: from __future__ import annotations
  import functools
  from typing import Optional, Tuple, Union
  import numpy
  import torch
  from torch import broadcast_tensors, nn
  from .compute_kernel import batched_dot
  from .sim import KG2E_SIMILARITIES
  from ..typing import GaussianDistribution
  from ..utils import clamp_norm, einsum, is_cudnn_error, make_ones_like, negative_norm, negative_norm_of_sum, project_entity, tensor_product, tensor_sum
label_desc: Use image node_id 2 for calling a global function with example usage: _add_cuda_warning(func) and returns: wrapped, func