code: def softmax(x: npt.NDArray) -> npt.NDArray:
      """Compute softmax values for each sets of scores in x.
  
      Args:
          x: 2D array of shape (n_samples, n_classes).
  
      Returns:
          2D array of shape (n_samples, n_classes).
      """
      row_wise_max = np.max(x, axis=1).reshape(-1, 1)
      exp_x = np.exp(x - row_wise_max)
      return exp_x / np.sum(exp_x, axis=1).reshape(-1, 1)
  
imports: from dataclasses import dataclass
  from typing import Callable, Dict, Tuple, Union
  import lightgbm
  import numpy
  import torch
  from lightgbm.callback import CallbackEnv
  from numpy import typing
  from ludwig.constants import NUMBER
  from ludwig.features.base_feature import BaseFeatureMixin, OutputFeature
  from ludwig.features.category_feature import CategoryOutputFeature
  from ludwig.models.base import BaseModel
label_desc: Use image node_id 4 for calling a global function with example usage: softmax(x) and returns: unknown