diff --git a/paddle/fluid/operators/custom_device_common_op_registry.cc b/paddle/fluid/operators/custom_device_common_op_registry.cc index 6fded8e113751465dab492c7a07683a38b62261b..d681bdcd58d8ff57c58caa42137c2f0dc8060204 100644 --- a/paddle/fluid/operators/custom_device_common_op_registry.cc +++ b/paddle/fluid/operators/custom_device_common_op_registry.cc @@ -320,12 +320,6 @@ class CSoftmaxWithCrossEntropyOpCustomDeviceKernel auto loss_dims = loss->dims(); const int64_t ignore_index = ctx.Attr("ignore_index"); - PADDLE_ENFORCE_LT(ignore_index, - 0, - platform::errors::InvalidArgument( - "When SoftmaxWithCrossEntropy run on CustomDevice, " - "ignore_index should be <=0, however it's %ld", - ignore_index)); const int rid = ctx.Attr("ring_id"); const int rank = ctx.Attr("rank");