code: def log_sum_exp(a: torch.Tensor, b: torch.Tensor):
      """
      Logsumexp with safety checks for infs.
      """
      if torch.isinf(a):
          return b
  
      if torch.isinf(b):
          return a
  
      if a > b:
          return math.log1p(math.exp(b - a)) + a
      else:
          return math.log1p(math.exp(a - b)) + b
  
imports: import math
  import multiprocessing
  from typing import Optional
  import numba
  import torch
  from torch.autograd import Function
  from espnet2.asr.transducer.rnnt_multi_blank.utils import global_constants
label_desc: Use image node_id 1 for calling a global function with example usage: log_sum_exp(a, b) and returns: b, a, unknown, unknown