code: def dice_loss(input, label, epsilon=0.00001, name=None):
      ivy.assertions.check_true(
          len(input.shape) >= 2,
          message="The rank of input should be greater than or equal to 2.",
      )
      ivy.assertions.check_true(
          len(input.shape) == len(label.shape),
          message=str(
              "The rank of input and label should be equal, "
              f"but received input: {len(input.shape)}, label: {len(label.shape)}."
          ),
      )
      ivy.assertions.check_true(
          label.shape[-1] == 1,
          message=str(
              f"The last dimension of label should be 1, but received {label.shape[-1]}."
          ),
      )
      ivy.assertions.check_true(
          tuple(input.shape[:-1]) == tuple(label.shape[:-1]),
          message="All dimensions should be equal except the last one.",
      )
      ivy.assertions.check_true(
          input.size > 0 and label.size > 0,
          message="Any dimension of input and label cannot be equal to 0.",
      )
      label = ivy.squeeze(label, axis=-1)
      label = ivy.one_hot(label, input.shape[-1])
      reduce_dim = list(range(1, len(input.shape)))
      intersect = ivy.multiply(input, label)
      inse = ivy.sum(intersect, axis=reduce_dim)
      dice_denominator = ivy.sum(input, axis=reduce_dim) + ivy.sum(
          label, axis=reduce_dim
      )
      dice_score = 1 - inse * 2 / (dice_denominator + epsilon)
      return ivy.mean(dice_score)
  
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 6 for calling a global function with example usage: dice_loss(input, label, epsilon, name) and returns: ivy