def METHOD_NAME(source: Tensor, *, label_prob: Union[Tensor, float]) -> Tensor:
    """
    Smooth variant of :func:`one_hot`.
    Uses ``label_prob`` for the labels and ``(1 - label_prob) / (dim - 1)`` for the remaining values.
    This is used for label smoothing.
    """
    assert source.sparse_dim
    if source.sparse_dim.dimension is None:
        raise NotImplementedError(f"smooth_one_hot({source}) not implemented for dynamic dims")
    return rf.sparse_to_dense(
        source, label_value=label_prob, other_value=(1.0 - label_prob) / (source.sparse_dim.dimension - 1)
    )