diff --git a/paddle/fluid/operators/clip_by_norm_op.h b/paddle/fluid/operators/clip_by_norm_op.h index f6f99369636268b2d628a211e636f8e0770cfbcf..a8d1e8e4661bff87da4c982d638fe56ef8e56ec7 100644 --- a/paddle/fluid/operators/clip_by_norm_op.h +++ b/paddle/fluid/operators/clip_by_norm_op.h @@ -63,8 +63,10 @@ class ClipByNormKernel : public framework::OpKernel { output->Resize(merged_input->value().dims()); output->mutable_data(context.GetPlace()); } else { - PADDLE_THROW("Unexpected branch, input variable type is %s", - framework::ToTypeName(in_var->Type())); + PADDLE_THROW(platform::errors::InvalidArgument( + "Invalid input variable type, only support LodTensor and " + "SelectedRows types, but got type is %s.", + framework::ToTypeName(in_var->Type()))); } PADDLE_ENFORCE_NOT_NULL(input,