code: def is_cuda_out_of_memory(exception: BaseException) -> bool:
      return (
          isinstance(exception, RuntimeError)
          and len(exception.args) == 1
          and "CUDA" in exception.args[0]
          and "out of memory" in exception.args[0]
      )
  
imports: from typing import Any, Union
  import numpy
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: is_cuda_out_of_memory(exception) and returns: unknown