Created by: lelelelelez
不合规报错检查增强
测试脚本 1. Op InferShape的输入输出检查
-
修改前报错:
Input W of FusedEmbeddingSeqPoolOp should not be null.
-
修改后使用新的检测宏
OP_INOUT_CHECK(ctx->HasInput("X"), "Input", "X", "Mul")
,保证Op的输入输出检查报错信息均一致。NotFoundError: No Input(Ids) found for FusedEmbeddingSeqPool operator.
2. 输入的table的dim等于2
-
修改前无报错
-
修改后报错
InvalidArgumentError: The dim size of the input tensor 'W' should be 2. But received W's size =1
3. Input tensor Ids's dim size 大于等于1
-
修改前报错:
The dim size of the 'Ids' tensor must greater than 1.
-
修改后报错:
InvalidArgumentError: The dim size of the 'Ids' tensor should be greater than or equal to 1. But received Id's size = 0
4. The last dimension of the input tensor 'Ids' 等于1
-
修改前报错:
The last dimension of the 'Ids' tensor must be 1.
-
修改后报错:
InvalidArgumentError: The last dimension of the input tensor 'Ids' should be 1. But received Ids's size in the last dimension = 2
5. combiner 目前只支持sum
-
修改前无报错
-
修改后报错:
Unimplemented: The pooling type of sequence_pool only support sum now. So the 'combiner' must be 'sum'.
6. the LoD Level of Ids等于1
-
修改前无报错
-
修改后报错
InvalidArgumentError: In compile time, the LoD Level of Ids should be 1. But received the LoD Level of Ids = 2
7. table_width * idx_width 小于等于 out_width
-
修改前无报错
-
修改后报错:
InvalidArgumentError: table_width * idx_width should be less than or equal to out_width. But received table_width * idx_width = %s, out_width = %d.
8. Ids's lod[0] 大于0
-
修改前报错:
The LoD[0] could NOT be empty
-
修改后报错:
InvalidArgumentError: The LoD[0] should be greater than 1. But received LoD[0] = 0
9. the LoD of ids 等于 1
-
修改前报错:
The LoD level of Input(Ids) must be 1
-
修改后报错:
InvalidArgumentError: The LoD level of Input(Ids) should be 1. But received Ids's LoD level = 0