code: def logsumexp_kernel(distances, log_probabilities):
      i = cuda.grid(1)
      if i >= log_probabilities.size:
          return
      max_exp = distances[i, 0]
      for j in range(1, distances.shape[1]):
          if distances[i, j] > max_exp:
              max_exp = distances[i, j]
      sum = 0.0
      for j in range(0, distances.shape[1]):
          sum += math.exp(distances[i, j] - max_exp)
      log_probabilities[i] = math.log(sum) + max_exp
  
imports: from cuml.common.exceptions import NotFittedError
  from cuml.internals.import_utils import has_scipy
  from cuml.metrics import pairwise_distances
  from cuml.internals.base import Base
  from cuml.internals.input_utils import input_to_cuml_array
  from cuml.internals.input_utils import input_to_cupy_array
  from cuml.internals.safe_imports import gpu_only_import_from
  import math
  from cuml.internals.safe_imports import cpu_only_import
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 10 for calling a global function with example usage: logsumexp_kernel(distances, log_probabilities) without return types