Skip to content

Commit

Permalink
'test_file_corret'
Browse files Browse the repository at this point in the history
  • Loading branch information
yangguohao committed Mar 30, 2022
1 parent ea13abd commit 352ec13
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions python/paddle/fluid/tests/unittests/test_triplet_margin_loss.py
Expand Up @@ -19,7 +19,7 @@



def call_TripletMaginLoss_layer(input,
def call_TripletMarginLoss_layer(input,
positive,
negative,
p = 2,
Expand All @@ -33,7 +33,7 @@ def call_TripletMaginLoss_layer(input,
return res


def call_TripletMaginLoss_functional(input,
def call_TripletMarginLoss_functional(input,
positive,
negative,
p = 2,
Expand Down Expand Up @@ -71,10 +71,10 @@ def test_static(place,


if functional:
res = call_TripletMaginLoss_functional(input=input,positive=positive,negative=negative,p=p,eps=eps,
res = call_TripletMarginLoss_functional(input=input,positive=positive,negative=negative,p=p,eps=eps,
margin=margin,swap=swap,reduction=reduction)
else:
res = call_TripletMaginLoss_layer(input=input,positive=positive,negative=negative,p=p,eps=eps,
res = call_TripletMarginLoss_layer(input=input,positive=positive,negative=negative,p=p,eps=eps,
margin=margin,swap=swap,reduction=reduction)

exe = paddle.static.Executor(place)
Expand All @@ -97,10 +97,10 @@ def test_dygraph(place,
negative = paddle.to_tensor(negative)

if functional:
dy_res = call_TripletMaginLoss_functional(input=input,positive=positive,negative=negative,p=p,eps=eps,
dy_res = call_TripletMarginLoss_functional(input=input,positive=positive,negative=negative,p=p,eps=eps,
margin=margin,swap=swap,reduction=reduction)
else:
dy_res = call_TripletMaginLoss_layer(input=input,positive=positive,negative=negative,p=p,eps=eps,
dy_res = call_TripletMarginLoss_layer(input=input,positive=positive,negative=negative,p=p,eps=eps,
margin=margin,swap=swap,reduction=reduction)
dy_result = dy_res.numpy()
paddle.enable_static()
Expand Down

0 comments on commit 352ec13

Please sign in to comment.