From 3fd2e7659dd754d01115c5071e6988cfa5707551 Mon Sep 17 00:00:00 2001 From: LyndonKong Date: Mon, 8 May 2023 10:58:18 +0800 Subject: [PATCH] Fix sample code of poisson_nll_loss (#53551) --- python/paddle/nn/functional/loss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/paddle/nn/functional/loss.py b/python/paddle/nn/functional/loss.py index b105d3d7fc2..ae7b8813a0e 100644 --- a/python/paddle/nn/functional/loss.py +++ b/python/paddle/nn/functional/loss.py @@ -1541,7 +1541,7 @@ def poisson_nll_loss( input = paddle.randn([5, 2], dtype=paddle.float32) label = paddle.randn([5, 2], dtype=paddle.float32) - loss = F.poisson_nll_loss(input, label, log_input=True, reduction='None') + loss = F.poisson_nll_loss(input, label, log_input=True, reduction='none') print(loss) loss = F.poisson_nll_loss(input, label, reduction='mean') print(loss) -- GitLab