We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents caffcc8 + e8f65b8 commit 6226b82Copy full SHA for 6226b82
python/paddle/trainer_config_helpers/layers.py
@@ -4873,7 +4873,7 @@ def nce_layer(input,
4873
if neg_distribution is not None:
4874
assert isinstance(neg_distribution, collections.Sequence)
4875
assert len(neg_distribution) == num_classes
4876
- assert sum(neg_distribution) == 1
+ assert abs(sum(neg_distribution) - 1.0) < 1e-5
4877
if not isinstance(act, BaseActivation):
4878
raise TypeError()
4879
0 commit comments