code: def sparse_categorical_crossentropy(
      target, output, from_logits=False, axis=-1
  ):
      target = convert_to_tensor(target, dtype=torch.long)
      output = convert_to_tensor(output)
  
      if (
          len(target.shape) == len(output.shape)
          and target.shape[-1] == 1
      ):
          target = torch.squeeze(target, dim=-1)
  
      if len(output.shape) < 1:
          raise ValueError(
              "Argument `output` must be at least rank 1. "
              "Received: "
              f"output.shape={output.shape}"
          )
      if target.shape != output.shape[:-1]:
          raise ValueError(
              "Arguments `target` and `output` must have the same shape "
              "up until the last dimension: "
              f"target.shape={target.shape}, output.shape={output.shape}"
          )
      if from_logits:
          log_prob = tnn.log_softmax(output, dim=axis)
      else:
          output = output / torch.sum(output, dim=axis, keepdim=True)
          output = torch.clip(output, epsilon(), 1.0 - epsilon())
          log_prob = torch.log(output)
      target = one_hot(target, output.shape[axis], axis=axis)
      return -torch.sum(target * log_prob, dim=axis)
  
imports: import torch
  import torch.nn.functional
  import tree
  from keras.backend import standardize_data_format
  from keras.backend import standardize_dtype
  from keras.backend.common.backend_utils import compute_conv_transpose_padding_args_for_torch
  from keras.backend.config import epsilon
  from keras.backend.torch.core import cast
  from keras.backend.torch.core import convert_to_tensor
  from keras.backend.torch.core import get_device
  from keras.backend.torch.numpy import expand_dims
  from keras.backend.torch.numpy import maximum
  from keras.backend.torch.numpy import where
  from keras.utils.argument_validation import standardize_tuple
label_desc: Use image node_id 31 for calling a global function with example usage: sparse_categorical_crossentropy(target, output, from_logits, axis) and returns: unknown