code: def softmax_with_cross_entropy(
      logits,
      label,
      soft_label=False,
      ignore_index=-100,
      numeric_stable_mode=True,
      return_softmax=False,
      axis=-1,
  ):
      input_dims = len(list(logits.shape))
      if input_dims == 0:
          raise ValueError(
              "The dimension of input should be larger than zero!"
          )
      label_dims = len(list(label.shape))
      if input_dims - 1 != label_dims and input_dims != label_dims:
          raise ValueError(
              "Expected nput_dims - 1 = label_dims or input_dims == label_dims          "
              f"   (got nput_dims{input_dims}, label_dims{label_dims})"
          )
      logits = ivy.array(logits)
      label = ivy.array(label)
      if input_dims - 1 == label_dims:
          label = ivy.expand_dims(label, axis=axis)
      if numeric_stable_mode:
          max_logits = ivy.max(logits, axis=axis, keepdims=True)
          log_max_sum_logits = ivy.log(
              ivy.sum(
                  ivy.exp(ivy.subtract(logits, max_logits)),
                  axis=axis,
                  keepdims=True,
              )
          )
          softmax = ivy.exp(
              ivy.subtract(
                  ivy.subtract(logits, max_logits), log_max_sum_logits
              )
          )
      else:
          softmax = ivy.softmax(logits, axis=axis)
  
      if soft_label:
          loss = -ivy.sum(
              ivy.multiply(
                  label,
                  ivy.subtract(
                      logits,
                      ivy.log(
                          ivy.sum(
                              ivy.exp(logits), axis=axis, keepdims=True
                          )
                      ),
                  ),
              ),
              axis=axis,
              keepdims=True,
          )
      else:
          mask = ivy.not_equal(
              label.astype("float64"), float(ignore_index)
          )
          loss = ivy.add(
              -ivy.take_along_axis(logits, label, axis),
              ivy.log(
                  ivy.sum(ivy.exp(logits), axis=axis, keepdims=True)
              ),
          )
          loss = ivy.multiply(loss, mask)
      if return_softmax:
          return paddle.to_tensor(loss), paddle.to_tensor(softmax)
      return paddle.to_tensor(loss)
  
imports: import ivy
  from ivy.func_wrapper import with_supported_dtypes
  import ivy.functional.frontends.paddle
  from ivy.utils.exceptions import handle_exceptions
  from ivy.functional.frontends.paddle.func_wrapper import inputs_to_ivy_arrays, to_ivy_arrays_and_back
label_desc: Use image node_id 17 for calling a global function with example usage: softmax_with_cross_entropy(logits, label, soft_label, ignore_index, numeric_stable_mode, return_softmax, axis) and returns: paddle, paddle,  paddle