Skip to content

Commit

Permalink
Update: Cross Entropy Torch Frontend (ivy-llc#25881)
Browse files Browse the repository at this point in the history
  • Loading branch information
HaiderSultanArc authored and iababio committed Sep 27, 2023
1 parent a034740 commit d2e81d7
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,7 @@ def cross_entropy(
reduction="mean",
label_smoothing=0.0,
):
input = ivy.softmax(input)
ret = ivy.cross_entropy(target, input, epsilon=label_smoothing)
if weight is not None:
ret = ivy.multiply(weight, ret)
ret = _apply_reduction(reduction, size_average, reduce, ret)
return ret
return ivy.cross_entropy(target, input, epsilon=label_smoothing)


@to_ivy_arrays_and_back
Expand Down

0 comments on commit d2e81d7

Please sign in to comment.