Skip to content

It is required to include LoDTensor input with instance_size=0 in sequence OP test (English Version)

Tao Luo edited this page Jan 15, 2020 · 1 revision

It is required to include instance size 0 LoDTensor input in sequence OP test


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.

1. Background

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.

2. Details of the Specification

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

3. Instructions of CI

  • 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

4. Suggestions For Check Failure

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's get_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

Clone this wiki locally