summaryrefslogtreecommitdiff
path: root/torch/nn
diff options
context:
space:
mode:
authorElias Ellison <eellison@fb.com>2019-01-15 10:56:17 -0800
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2019-01-15 11:34:51 -0800
commit7d601715e5ca21cd15319d06a2f52aca77e60f9b (patch)
tree17d8e559a3e574f583cfbc4595bbc746cbc23e34 /torch/nn
parent9a6fe4feec7e19436e3310ced562abd3b6fdd70c (diff)
downloadpytorch-7d601715e5ca21cd15319d06a2f52aca77e60f9b.tar.gz
pytorch-7d601715e5ca21cd15319d06a2f52aca77e60f9b.tar.bz2
pytorch-7d601715e5ca21cd15319d06a2f52aca77e60f9b.zip
Constant prop prim::None (#15979)
Summary: Previously we were only constant propping prim::Constants, but we should be constant propping prim::None as well. Pull Request resolved: https://github.com/pytorch/pytorch/pull/15979 Differential Revision: D13664692 Pulled By: eellison fbshipit-source-id: 01839403576c21fc030c427e49275b8e1210fa8f
Diffstat (limited to 'torch/nn')
-rw-r--r--torch/nn/functional.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/torch/nn/functional.py b/torch/nn/functional.py
index dfa47a1994..9f1494c406 100644
--- a/torch/nn/functional.py
+++ b/torch/nn/functional.py
@@ -1855,9 +1855,9 @@ def poisson_nll_loss(input, target, log_input=True, full=False, size_average=Non
if full:
mask = target > 1
loss[mask] += (target * torch.log(target) - target + 0.5 * torch.log(2 * math.pi * target))[mask]
- if reduction is 'none':
+ if reduction == 'none':
ret = loss
- if reduction is 'mean':
+ if reduction == 'mean':
ret = torch.mean(loss)
else:
ret = torch.sum(loss)