From 357341381c7cc5433bf9a595a06e5bef0604bd9a Mon Sep 17 00:00:00 2001 From: chajchaj <57249073+chajchaj@users.noreply.github.com> Date: Wed, 14 Oct 2020 20:07:31 +0800 Subject: [PATCH] del the DEFINE_ALIAS of sigmoid_cross_entropy_with_logits (#27883) * del the DEFINE_ALIAS of sigmoid_cross_entropy_with_logits * del sigmoid_cross_entropy_with_logits in python/paddle/nn/functional/loss.py, test=develop * call paddle.fluid.layers.sigmoid_cross_entropy_with_logits in bce_with_logits_loss, test=develop --- python/paddle/nn/functional/__init__.py | 1 - python/paddle/nn/functional/loss.py | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/python/paddle/nn/functional/__init__.py b/python/paddle/nn/functional/__init__.py index b76b533f224..b95693f386e 100644 --- a/python/paddle/nn/functional/__init__.py +++ b/python/paddle/nn/functional/__init__.py @@ -143,7 +143,6 @@ from .loss import nll_loss #DEFINE_ALIAS from .loss import npair_loss #DEFINE_ALIAS from .loss import rank_loss #DEFINE_ALIAS from .loss import sampled_softmax_with_cross_entropy #DEFINE_ALIAS -from .loss import sigmoid_cross_entropy_with_logits #DEFINE_ALIAS from .loss import sigmoid_focal_loss #DEFINE_ALIAS from .loss import smooth_l1 #DEFINE_ALIAS from .loss import smooth_l1_loss #DEFINE_ALIAS diff --git a/python/paddle/nn/functional/loss.py b/python/paddle/nn/functional/loss.py index d085213dffc..4102ec3fa0c 100644 --- a/python/paddle/nn/functional/loss.py +++ b/python/paddle/nn/functional/loss.py @@ -31,7 +31,6 @@ from ...fluid.layers import log_loss #DEFINE_ALIAS from ...fluid.layers import npair_loss #DEFINE_ALIAS from ...fluid.layers import rank_loss #DEFINE_ALIAS from ...fluid.layers import reshape -from ...fluid.layers import sigmoid_cross_entropy_with_logits #DEFINE_ALIAS from ...fluid.layers import smooth_l1 #DEFINE_ALIAS from ...fluid.layers import softmax_with_cross_entropy #DEFINE_ALIAS from ...fluid.layers import square_error_cost #DEFINE_ALIAS @@ -66,7 +65,6 @@ __all__ = [ 'npair_loss', 'rank_loss', 'sampled_softmax_with_cross_entropy', - 'sigmoid_cross_entropy_with_logits', 'sigmoid_focal_loss', 'smooth_l1', 'smooth_l1_loss', @@ -316,7 +314,7 @@ def binary_cross_entropy_with_logits(logit, if reduction == 'none' and pos_weight is None and weight is None: sigmoid_name = name - out = paddle.nn.functional.sigmoid_cross_entropy_with_logits( + out = paddle.fluid.layers.sigmoid_cross_entropy_with_logits( logit, label, name=sigmoid_name) one = paddle.fill_constant(shape=[1], value=1.0, dtype=logit.dtype) -- GitLab