样例步骤适用于以下产品。
atc --singleop=config/add_op.json --soc_version=Ascendxxx --output=op_models
模型转换成功后,会生成如下文件:
在当前目录的“op_model”目录下生成单算子的模型文件“0_Add_3_2_8_16_3_2_8_16_3_2_8_16.om”。
算子模型文件的命名规范为:序号 + opType + 输入的描述(dateType_format_shape) + 输出的描述。
python3 ../src/acl_execute_add.py
factor_a: [[85 19 20 27 74 27 47 73 69 82 81 78 25 45 1 84] [46 52 93 42 7 69 38 68 68 57 58 64 53 14 55 95] [35 87 81 50 5 8 97 58 14 18 92 91 97 86 91 11] [35 71 23 0 74 66 2 80 74 44 20 53 70 67 67 56] [ 6 52 5 66 9 86 8 14 60 65 16 80 82 56 90 59] [50 24 79 53 13 94 6 46 46 68 39 76 56 56 9 28] [92 7 67 43 39 20 2 52 17 5 46 0 6 98 31 25] [ 8 37 45 29 23 19 35 25 90 71 70 15 90 55 15 29]] factor_b: [[29 9 73 35 34 5 52 22 74 84 11 85 73 68 70 59] [57 73 78 90 75 46 28 4 69 81 2 15 9 21 76 7] [90 59 81 57 80 33 92 98 15 86 98 22 9 25 35 70] [94 54 15 65 2 62 32 55 32 91 3 38 96 51 24 86] [96 84 33 32 86 61 24 66 47 80 76 4 86 29 39 20] [48 97 68 4 42 19 60 43 72 0 68 65 80 43 38 54] [83 10 54 90 60 35 84 22 22 5 70 67 79 78 45 41] [51 19 66 74 4 72 54 23 32 42 9 49 93 52 50 83]] init resource stage: init resource success gen input data stage: gen input data success gen output data stage: gen output data success execute stage: execute success get operator result stage: shape: (8, 16) ACL output: [[114 28 93 62 108 32 99 95 143 166 92 163 98 113 71 143] [103 125 171 132 82 115 66 72 137 138 60 79 62 35 131 102] [125 146 162 107 85 41 189 156 29 104 190 113 106 111 126 81] [129 125 38 65 76 128 34 135 106 135 23 91 166 118 91 142] [102 136 38 98 95 147 32 80 107 145 92 84 168 85 129 79] [ 98 121 147 57 55 113 66 89 118 68 107 141 136 99 47 82] [175 17 121 133 99 55 86 74 39 10 116 67 85 176 76 66] [ 59 56 111 103 27 91 89 48 122 113 79 64 183 107 65 112]] get operator result success release source stage: release source success