Updated on 2022-03-13 GMT+08:00

Building an Input Data File

To run a single operator, you need to build input data and save it in binary format to the operator project.

  1. Go to the operator code directory of the custom operator project as the DDK installation user.

    cd $HOME/tools/projects/customop_te/operator/

  2. Run the script compiled based on sample data to generate a sample data file for the reduction operator.

    python data_gen.py reduction

    The data files shown in Figure 1 are generated in the operator project.

    Figure 1 Generated sample data

    Table 1 describes the data files.

    Table 1 Description of data files

    Data File

    Description

    Reduction_input_2_3_4_sum_axis_1.data

    Indicates the input data file in binary format of the reduction operator.

    Reduction_input_2_3_4_sum_axis_1.txt

    Displays the binary file of the reduction operator in .txt format to facilitate result viewing.

    Reduction_output_2_3_4_sum_axis_1.data

    Indicates the output data verification file in binary format of the reduction operator, which is used to verify whether the output of the operator is correct after the operator runs.

    Reduction_output_2_3_4_sum_axis_1.txt

    Displays the binary file of the reduction operator in .txt format to facilitate result viewing.