Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit d3d600d

Browse files
qlzh727lyyanlely
authored andcommitted
Remove the usage of legacy keras code in tensorflow/python/keras.
Replace it with public tf.keras API. PiperOrigin-RevId: 484050549
1 parent 2503f62 commit d3d600d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tensorflow_ranking/python/keras/losses.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import tensorflow.compat.v2 as tf
2020

21-
from tensorflow.python.keras.utils import losses_utils
2221
from tensorflow_ranking.python import losses_impl
2322
from tensorflow_ranking.python.keras import utils
2423

@@ -678,7 +677,7 @@ def __call__(self,
678677
"""See _RankingLoss."""
679678
losses, sample_weight = self._loss.compute_per_list(y_true, y_pred,
680679
sample_weight)
681-
return losses_utils.compute_weighted_loss(
680+
return tf.keras.__internal__.losses.compute_weighted_loss(
682681
losses, sample_weight, reduction=self._get_reduction())
683682

684683

0 commit comments

Comments
 (0)