-
Notifications
You must be signed in to change notification settings - Fork 5.6k
It is required to include LoDTensor input with instance_size=0 in sequence OP test (English Version)
Sequence相关Op单测中必须包含instance size为0的LoDTensor输入
Specification summary::
- Section 1, Background
- Section 2, Details of The Specification
- Section 3, Instructions of CI
- Section 4, Suggestions Of Check Failure
Supplementary Note:
You may find some aspects that are not taken into account in the existing specifications, which need to be continuously supplemented and improved during the implementation process. Please feel free to give your feedback.
For a one-dimensional LoD, each element of LoD can be understood as the sentence length. There may be a case where the sentence length is equal to 0, a single test must include a case where the sentence length is equal to 0. Otherwise, a bug may occur during actual operation.
Inspection Scope: In sequence OP's unit test, it is required to call Class OpTest
's get_sequence_instance_size_0_input
method at least once to get LoDTensor input with instance size = 0.
Special Cases:
- You can exempt it by describing the reason for skipping this check and add it to whitelist
NEED_TO_FIX_OP_LIST
. - White list location: python/paddle/fluid/tests/unittests/white_list/check_op_sequence_instance_0_input_white_list.py
, you can skip this check by adding the OP's name to the
NEED_TO_FIX_OP_LIST
. Except for special cases, other unit tests are required to carry out this inspection.
- When the white list file
check_op_sequence_instance_0_input_white_list.py
is modified, CI incremental detection will be triggered, you need to describe the reason for skipping this check and ask for specific personnel to review
When the check fails, you can modify the unit test by referring to the following suggestions:
- Check if the OP has a unit test file named "python/paddle/fluid/tests/unittests/sequence/test_${op_name}.py"
- Check if the unit test has
Class OpTest
'sget_sequence_instance_size_0_input
function call at least once to get LoDTensor input with instance size 0.
If you encounter other problems, please contact @JepsonWong