From b354acc7fc14f1e1dddc325a0dedf7d50fd54efe Mon Sep 17 00:00:00 2001 From: baiyfbupt Date: Mon, 28 Sep 2020 10:28:34 +0800 Subject: [PATCH] migrate code example and doc --- python/paddle/fluid/layers/loss.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/paddle/fluid/layers/loss.py b/python/paddle/fluid/layers/loss.py index 97374c038d9..f88e4f6536f 100644 --- a/python/paddle/fluid/layers/loss.py +++ b/python/paddle/fluid/layers/loss.py @@ -333,9 +333,9 @@ def square_error_cost(input, label): input = paddle.to_tensor([1.1, 1.9]) label = paddle.to_tensor([1.0, 2.0]) output = paddle.fluid.layers.square_error_cost(input, label) - # output = [0.01, 0.01] + print(output.numpy()) + # [0.01, 0.01] - # [0.04000002] """ check_variable_and_dtype(input, "input", ['float32', 'float64'], 'square_error_cost') @@ -1779,8 +1779,8 @@ def mse_loss(input, label): input = paddle.to_tensor([1.1, 1.9]) label = paddle.to_tensor([1.0, 2.0]) output = paddle.fluid.layers.mse_loss(input, label) - # output = 0.01 - + print(output.numpy()) + # [0.01] """ check_variable_and_dtype(input, "input", ['float32', 'float64'], 'mse_loss') check_variable_and_dtype(label, "label", ['float32', 'float64'], 'mse_loss') -- GitLab