Fields in the AI CPU ST Operator Test Case Definition File
Field |
Description |
|
|---|---|---|
Test_xxx_xx |
- |
Mandatory. A string. Test case name. |
Input[xx] |
- |
Mandatory. Operator input. NOTICE:
The number of parameter values in each input of an operator must be the same. Otherwise, test case generation fails. For example, if the Input[01] supports two formats, the Input[02] also supports two formats. Similarly, the parameter values of type, shape, data_distribute, and value_range in all Input[xx] must be the same. |
- |
Name |
Mandatory. Operator input name, which is of the string type. If the expectation function is configured, the operator input name must be the same as that input in the expectation function. |
- |
Format |
Mandatory. A string or a 1D array of strings. Format of the input tensor. Must not be empty. Common data formats are as follows:
Note that the numbers of formats, types, and shapes must be the same. |
- |
OriginFormat |
Optional. Original tensor format. If this parameter is not carried, the original tensor format is retained. |
- |
Type |
Mandatory. A string or a 1D array of strings. Input data type.
Note that the numbers of formats, types, and shapes must be the same. |
- |
Shape |
Mandatory. An int or a 1D or 2D array of ints. Input tensor shape. Example: [8, 3, 256, 256] or [[1, 3, 256, 256], [8, 3, 256, 256]]. If you enter an invalid shape, for example, [0], an error is reported. Note that the numbers of formats, types, and shapes must be the same. |
- |
OriginShape |
Optional. Original tensor shape. If this field is not carried, the original tensor shape is retained. |
- |
Value |
Optional. Path string or tensor array. If you need to specify the input data, you can add the Value field. There are two configuration methods: Enter tensor data, for example, [1,2,3,4]. "Value": [1,2,3,4] Specify the path of a binary file, for example, test.bin. "Value": "home/HiHwAiUser/projects/test.bin" Prepare the .bin file by yourself. You can enter an absolute path. If the Value field is added, the DataDistribute and ValueRange fields will be hidden. As such, ensure that the value of the Value field is consistent with those of Format, Type, and Shape fields. |
- |
ValueRange |
Mandatory. An int or float, or a 1D or 2D array of ints or floats. Value range. Must not be left empty. Formatted as [min_value, max_value], with min_value <= max_value. |
- |
DataDistribute |
Mandatory. A string or a 1D array of strings. Data distribution mode for generating test data.
|
- |
isConst |
Optional. The value is of the Bool type. The default value is false.
|
Output[xx] |
- |
Mandatory. Operator output. NOTICE:
The number of values in Output must be the same as that in Input. Otherwise, test case generation fails. For example, if Input supports two formats, the Output also supports two formats. |
- |
Name |
Mandatory. Operator input name, which is of the string type. If the expectation function is configured, the operator output name must be the same as that output from the expectation function. |
- |
Format |
Mandatory. A string or a 1D array of strings. Format of the output tensor. Must not be empty. Common data formats are as follows:
Note that the numbers of formats, types, and shapes must be the same. |
- |
OriginFormat |
Optional. Original tensor format. If this parameter is not carried, the original tensor format is retained. |
- |
Type |
Mandatory. A string or a 1D array of strings. Output data type.
Note that the numbers of formats, types, and shapes must be the same. |
- |
Shape |
Mandatory. An int or a 1D or 2D array of ints. Input tensor shape. Example: [8, 3, 256, 256] or [[1, 3, 256, 256], [8, 3, 256, 256]]. If you enter an invalid shape, for example, [0], an error is reported. Note that the numbers of formats, types, and shapes must be the same. |
- |
OriginShape |
Optional. Original tensor shape. If this field is not carried, the original tensor shape is retained. |
Attribute |
- |
Optional. |
- |
Name |
Required if attr is configured. A string. Attribute name. Must not be empty. |
- |
Type |
Required if attr is configured. Attribute data type. A string. Output data type.
|
- |
Value |
Required if attr is configured. Must not be null. A string. Attribute value. Varies according to type.
|
Expected Result Verification |
- |
Optional. |
- |
Script Path |
Path of the test function for generating expected operator result. |
- |
Script Function |
Name of the test function for generating expected operator result. |
K-Level Test Cases |
- |
Optional. |
- |
Fuzz Script Path |
Optional. Path of the string type. Relative or absolute path of the fuzz testing script. |
- |
Fuzz Case Num |
Optional. An int. Number of test cases generated using a script. The value range is [1, 2000]. |
- |
Fuzz Function |
Optional. A string. Name of the function for generating fuzzing input in the fuzzing script. The default value is fuzz_branch. |
- When inputx.paramType in the operator information library definition file (.ini) is set to optional, set format of inputx to UNDEFINED or RESERVED, and type to UNDEFINED in the generated operator test cases.
- In the operator information library definition file (.ini), if a tensor implementation uses a Huawei-developed format and is different from the original format, you need to manually enter the original format and shape in OriginFormat and OriginShape to convert the format and shape into those compatible with the offline model.
- OriginFormat is an array specifying the formats supported by the original operator. The array must have the same length as the Format array.
- The value of OriginShape must correspond to the value of Shape and match the values of Format and OriginFormat.
- All parameters except Type of name and Attr in Input[xx], Output[xx], and Attr support fuzz input.

