diff --git a/paddle/fluid/operators/nce_op.h b/paddle/fluid/operators/nce_op.h index 7397d9f47353dd3231f49196c6ec78489e44b92a..afb14c307136b5009c49726083e70597e6238531 100644 --- a/paddle/fluid/operators/nce_op.h +++ b/paddle/fluid/operators/nce_op.h @@ -194,6 +194,8 @@ class NCEKernel : public framework::OpKernel { sample_out_data[i] += result(0); sample_out_data[i] = (1. / (1. + exp(-sample_out_data[i]))); } + + context.scope().DeleteScope(&local_scope); #endif } else { auto weight_mat =