code: def logsumexp(input, dim, keepdim=False, *, out=None):
      c = ivy.max(input, axis=dim, keepdims=True)
      if ivy.get_num_dims(c) > 0:
          c = ivy.where(ivy.isinf(c), ivy.zeros_like(c), c)
      elif not ivy.isinf(c):
          c = 0
      exponential = ivy.exp(input - c)
      sum = ivy.sum(exponential, axis=dim, keepdims=keepdim)
      ret = ivy.log(sum)
      if not keepdim:
          c = ivy.squeeze(c, axis=dim)
      ret = ivy.add(ret, c, out=out)
      return ret
  
imports: import ivy
  from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
  from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back, numpy_to_torch_style_args
  from collections import namedtuple
  import ivy.functional.frontends.torch
label_desc: Use image node_id 10 for calling a global function with example usage: logsumexp(input, dim, keepdim) and returns: ret