Skip to content

Commit

Permalink
Merge pull request #15015 from old-school-kid:master
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 387624927
  • Loading branch information
tensorflower-gardener committed Jul 29, 2021
2 parents b3dc1e6 + f175038 commit a9b4be7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion keras/losses.py
Original file line number Diff line number Diff line change
Expand Up @@ -1734,7 +1734,7 @@ def sparse_categorical_crossentropy(y_true, y_pred, from_logits=False, axis=-1):
Sparse categorical crossentropy loss value.
"""
y_pred = tf.convert_to_tensor(y_pred)
y_true = tf.cast(y_true, y_pred.dtype)

return backend.sparse_categorical_crossentropy(
y_true, y_pred, from_logits=from_logits, axis=axis)

Expand Down

0 comments on commit a9b4be7

Please sign in to comment.