Skip to content

Commit

Permalink
Remove the usage of legacy keras code in tensorflow/python/keras.
Browse files Browse the repository at this point in the history
Replace it with public tf.keras API.

PiperOrigin-RevId: 484050549
  • Loading branch information
qlzh727 authored and lyyanlely committed Oct 26, 2022
1 parent 2503f62 commit d3d600d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tensorflow_ranking/python/keras/losses.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import tensorflow.compat.v2 as tf

from tensorflow.python.keras.utils import losses_utils
from tensorflow_ranking.python import losses_impl
from tensorflow_ranking.python.keras import utils

Expand Down Expand Up @@ -678,7 +677,7 @@ def __call__(self,
"""See _RankingLoss."""
losses, sample_weight = self._loss.compute_per_list(y_true, y_pred,
sample_weight)
return losses_utils.compute_weighted_loss(
return tf.keras.__internal__.losses.compute_weighted_loss(
losses, sample_weight, reduction=self._get_reduction())


Expand Down

0 comments on commit d3d600d

Please sign in to comment.