Skip to content

Commit 4a22979

Browse files
committed
Polish code
test=develop
1 parent f03e0e4 commit 4a22979

File tree

1 file changed

+8
-8
lines changed
  • python/paddle/fluid/layers

1 file changed

+8
-8
lines changed

python/paddle/fluid/layers/nn.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5831,7 +5831,7 @@ def rank_loss(label, left, right, name=None):
58315831
def margin_rank_loss(label, left, right, margin=0.1, name=None):
58325832
"""
58335833
Margin Ranking Loss Layer for ranking problem,
5834-
which compare left score and right score passed in.
5834+
which compares left score and right score passed in.
58355835
The ranking loss can be defined as following equation:
58365836
58375837
.. math::
@@ -5842,7 +5842,7 @@ def margin_rank_loss(label, left, right, margin=0.1, name=None):
58425842
label (Variable): Indicates whether the left is ranked higher than the right or not.
58435843
left (Variable): Ranking score for left.
58445844
right (Variable): Ranking score for right.
5845-
margin (float): Indicates the given margin to be added to right
5845+
margin (float): Indicates the given margin.
58465846
name (str|None): A name for this layer (optional). If set None, the layer
58475847
will be named automatically.
58485848
Returns:
@@ -5857,12 +5857,12 @@ def margin_rank_loss(label, left, right, margin=0.1, name=None):
58575857
out = fluid.layers.margin_rank_loss(label, left, right)
58585858
"""
58595859
helper = LayerHelper('margin_rank_loss', **locals())
5860-
if not (isinstance(label, Variable)):
5861-
raise ValueError("The label should be a Variable")
5862-
if not (isinstance(left, Variable)):
5863-
raise ValueError("The left should be a Variable")
5864-
if not (isinstance(right, Variable)):
5865-
raise ValueError("The right should be a Variable")
5860+
if not isinstance(label, Variable):
5861+
raise ValueError("The label should be a Variable.")
5862+
if not isinstance(left, Variable):
5863+
raise ValueError("The left should be a Variable.")
5864+
if not isinstance(right, Variable):
5865+
raise ValueError("The right should be a Variable.")
58665866
out = helper.create_tmp_variable(left.dtype)
58675867
act = helper.create_tmp_variable(left.dtype)
58685868
helper.append_op(

0 commit comments

Comments
 (0)