You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 例如:`Suggested Fix:If your classifier expects one-hot encoding label,check your n_classes argument to the estimatorand/or the shape of your label.Otherwise, check the shape of your label.`
362
+
363
+
如果并非必要或者简洁的描述即可表达清楚以上要点,根据情况书写亦可。
364
+
365
+
##### FAQ 典型问题
366
+
367
+
1. 无报错信息或报错信息过于简单,不能给用户提供有效的提示!
368
+
369
+
问题示例1 :未写提示信息
370
+
```
371
+
PADDLE_ENFORCE(ctx->HasInput("X"), "");
372
+
```
373
+
问题示例2 :提示信息过于简单
374
+
```
375
+
PADDLE_ENFORCE(i != nullptr, "I must be set"); // I是什么?
376
+
```
377
+
378
+
2. 在报错信息中使用开发人员定义的变量缩写,不易理解!
379
+
380
+
问题示例:
381
+
```
382
+
PADDLE_ENFORCE(forward_pd != nullptr,
383
+
"Fail to find eltwise_fwd_pd in device context"); //eltwise_fwd_pd用户可能看不懂
384
+
```
385
+
386
+
#### OP InferShape检查提示信息特别说明
387
+
388
+
- 检查输入输出变量,请统一遵循以下格式
389
+
`Input(变量名) of OP名 operator should not be null.`
390
+
391
+
正确示例:
392
+
```
393
+
PADDLE_ENFORCE(ctx->HasInput("Input"),
394
+
"Input(Input) of LSTMP operator should not be null.");
395
+
```
396
+
397
+
- 反向Op的输入输出检查,要写明反向Op的名字
398
+
399
+
正确示例:
400
+
```
401
+
PADDLE_ENFORCE(ctx->HasInput("X"),
402
+
"Input(X) of LoDResetGrad opreator should not be null.");
0 commit comments