code: def _conditional_amp_bwd_decorator(orig_func):  # type: ignore
      if hasattr(torch.cuda.amp, "custom_bwd"):
          return torch.cuda.amp.custom_bwd(orig_func)  # type: ignore
  
      @functools.wraps(orig_func)
      def inner_decorator(*args: Any, **kwargs: Any) -> Any:
          return orig_func(*args, **kwargs)
  
      return inner_decorator
  
imports: from builtins import isinstance
  import functools
  import logging
  from typing import Any, List, Tuple
  import torch
  from torch import nn
label_desc: Use image node_id 2 for calling a global function with example usage: _conditional_amp_bwd_decorator(orig_func) and returns: inner_decorator, torch, orig_func