Merge pull request !3061 from DeshiChen/0711_akg_op_register_mastertags/v0.6.0-beta
| @@ -1,58 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Abs op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Abs", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32", | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32", | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _abs_akg(): | |||
| """Abs AutoDiff register""" | |||
| return | |||
| @@ -1,72 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """TensorAdd op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "TensorAdd", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "int32", "float16", "int32", "float32", "float32", | |||
| "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "DefaultFormat", "NC1HWC0", | |||
| "FracZ", "FracZ", "FracZ", "FRACTAL_NZ", "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16", "int32", "float16", "int32", "float32", "float32", | |||
| "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "DefaultFormat", "NC1HWC0", | |||
| "FracZ", "FracZ", "FracZ", "FRACTAL_NZ", "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "y" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "int32", "float16", "int32", "float32", "float32", | |||
| "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "DefaultFormat", "NC1HWC0", | |||
| "FracZ", "FracZ", "FracZ", "FRACTAL_NZ", "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _add_akg(): | |||
| """TensorAdd AutoDiff register""" | |||
| return | |||
| @@ -1,58 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """AddN op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "AddN", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16","float32","float16","float32", "float16", "float32", | |||
| "float16","float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat","DefaultFormat","NC1HWC0","NC1HWC0", "FracZ", "FracZ", | |||
| "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "param_type": "dynamic", | |||
| "name": "inputs" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16","float32","float16","float32", "float16", "float32", | |||
| "float16","float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat","DefaultFormat","NC1HWC0","NC1HWC0", "FracZ", "FracZ", | |||
| "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _add_n_akg(): | |||
| """AddN AutoDiff register""" | |||
| return | |||
| @@ -1,103 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """ApplyMomentum op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "ApplyMomentum", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| { | |||
| "name": "use_nesterov", | |||
| "param_type": "optional", | |||
| "type": "bool" | |||
| }, | |||
| { | |||
| "name": "gradient_scale", | |||
| "param_type": "optional", | |||
| "type": "float" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float32","float32","float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat","NC1HWC0","FracZ" | |||
| ], | |||
| "name": "variable" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float32","float32","float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat","NC1HWC0","FracZ" | |||
| ], | |||
| "name": "accumulation" | |||
| }, | |||
| { | |||
| "index": 2, | |||
| "dtype": [ | |||
| "float32","float32","float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat","DefaultFormat","DefaultFormat" | |||
| ], | |||
| "name": "learning_rate" | |||
| }, | |||
| { | |||
| "index": 3, | |||
| "dtype": [ | |||
| "float32","float32","float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat","NC1HWC0","FracZ" | |||
| ], | |||
| "name": "gradient" | |||
| }, | |||
| { | |||
| "index": 4, | |||
| "dtype": [ | |||
| "float32","float32","float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat","DefaultFormat","DefaultFormat" | |||
| ], | |||
| "name": "momentum" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float32","float32","float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat","NC1HWC0","FracZ" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _apply_momentum_akg(): | |||
| """ApplyMomentum AutoDiff register""" | |||
| return | |||
| @@ -1,58 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Argmax op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Argmax", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "OPAQUE", | |||
| "attr": [ | |||
| { | |||
| "name": "axis", | |||
| "param_type": "optional", | |||
| "type": "int" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "int32", "int32", "int32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _argmax_akg(): | |||
| """Argmax AutoDiff register""" | |||
| return | |||
| @@ -1,63 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Assign op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Assign", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "OPAQUE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "int32", "float16", "float32", "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0", "FracZ", "FracZ", "FracZ" | |||
| ], | |||
| "name": "ref" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "int32", "float16", "float32", "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0", "FracZ", "FracZ", "FracZ" | |||
| ], | |||
| "name": "value" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "int32", "float16", "float32", "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0", "FracZ", "FracZ", "FracZ" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _assign_akg(): | |||
| """Assign AutoDiff register""" | |||
| return | |||
| @@ -1,64 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """AssignAdd op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "AssignAdd", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "ref" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "value" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _assign_add_akg(): | |||
| """AssignAdd AutoDiff register""" | |||
| return | |||
| @@ -1,73 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """BatchMatMul op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "BatchMatMul", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "OPAQUE", | |||
| "attr": [ | |||
| { | |||
| "name": "transpose_a", | |||
| "param_type": "optional", | |||
| "type": "bool" | |||
| }, | |||
| { | |||
| "name": "transpose_b", | |||
| "param_type": "optional", | |||
| "type": "bool" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16" | |||
| ], | |||
| "format": [ | |||
| "FRACTAL_NZ" | |||
| ], | |||
| "name": "x1" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16" | |||
| ], | |||
| "format": [ | |||
| "FRACTAL_NZ" | |||
| ], | |||
| "name": "x2" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16" | |||
| ], | |||
| "format": [ | |||
| "FRACTAL_NZ" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _batchmatmul_akg(): | |||
| """BatchMatMul AKG register""" | |||
| return | |||
| @@ -1,68 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """BiasAdd op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "BiasAdd", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| { | |||
| "name": "data_format", | |||
| "param_type": "optional", | |||
| "type": "listStr" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16","float32","float16","float32","float16","float32" | |||
| ], | |||
| "format": [ | |||
| "NHWC","NHWC","NC1HWC0","NC1HWC0","DefaultFormat","DefaultFormat" | |||
| ], | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16","float32","float16","float32","float16","float32" | |||
| ], | |||
| "format": [ | |||
| "NHWC","NHWC","NC1HWC0","NC1HWC0","DefaultFormat","DefaultFormat" | |||
| ], | |||
| "name": "b" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16","float32","float16","float32","float16","float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat","DefaultFormat","NC1HWC0","NC1HWC0","DefaultFormat","DefaultFormat" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _bias_add_akg(): | |||
| """BiasAddGrad AutoDiff register""" | |||
| return | |||
| @@ -1,58 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """BiasAddGrad op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "BiasAddGrad", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "COMMREDUCE", | |||
| "attr": [ | |||
| { | |||
| "name": "data_format", | |||
| "param_type": "optional", | |||
| "type": "listStr" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16","float32","float16","float32","float16","float32" | |||
| ], | |||
| "format": [ | |||
| "NHWC","NHWC","NC1HWC0","NC1HWC0","DefaultFormat","DefaultFormat" | |||
| ], | |||
| "name": "dout" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16","float32","float16","float32","float16","float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat","DefaultFormat","NC1HWC0","NC1HWC0","DefaultFormat","DefaultFormat" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _bias_add_grad_akg(): | |||
| """BiasAddGrad AutoDiff register""" | |||
| return | |||
| @@ -1,74 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Cast op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Cast", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| { | |||
| "name": "dst_type", | |||
| "param_type": "required", | |||
| "type": "str" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "bool", "bool", | |||
| "float16", "float32", "int32", "int32", | |||
| "bool", | |||
| "float16", "float32", "bool", "bool", | |||
| "float16", "float32", "bool", "bool" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "DefaultFormat", | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "DefaultFormat", | |||
| "DefaultFormat", | |||
| "NC1HWC0", "NC1HWC0", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ", "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float32", "float16", "int32", "float16", | |||
| "int32", "int32", "float16", "float32", | |||
| "float32", | |||
| "float32", "float16", "int32", "float32", | |||
| "float32", "float16", "int32", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "DefaultFormat", | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "DefaultFormat", | |||
| "DefaultFormat", | |||
| "NC1HWC0", "NC1HWC0", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ", "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _cast_akg(): | |||
| """Cast AutoDiff register""" | |||
| return | |||
| @@ -1,64 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """ClearZero op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "ClearZero", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| { | |||
| "name": "pad_mod", | |||
| "param_type": "optional", | |||
| "type": "string" | |||
| }, | |||
| { | |||
| "name": "window", | |||
| "param_type": "optional", | |||
| "type": "int" | |||
| }, | |||
| { | |||
| "name": "pad", | |||
| "param_type": "optional", | |||
| "type": "int" | |||
| }, | |||
| { | |||
| "name": "stride", | |||
| "param_type": "optional", | |||
| "type": "int" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| ] | |||
| }""") | |||
| def _clear_zero_akg(): | |||
| """MaxPoolGradWithArgmax AutoDiff register""" | |||
| return | |||
| @@ -1,88 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Conv2D op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Conv2D", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "CONVLUTION", | |||
| "attr": [ | |||
| { | |||
| "name": "x_shape", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "w_shape", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "pad_list", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "stride", | |||
| "param_type": "optional", | |||
| "type": "int" | |||
| }, | |||
| { | |||
| "name": "dilation", | |||
| "param_type": "optional", | |||
| "type": "int" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16" | |||
| ], | |||
| "format": [ | |||
| "FracZ" | |||
| ], | |||
| "name": "w" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _conv2d_akg(): | |||
| """Conv2D AutoDiff register""" | |||
| return | |||
| @@ -1,88 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Conv2DBackpropFilter op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Conv2DBackpropFilter", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "CONVLUTION", | |||
| "attr": [ | |||
| { | |||
| "name": "input_shape", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "filter_sizes", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "stride", | |||
| "param_type": "optional", | |||
| "type": "int" | |||
| }, | |||
| { | |||
| "name": "pad_list", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "dilation", | |||
| "param_type": "optional", | |||
| "type": "int" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "out_backprop" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "input" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "FracZ" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _conv2d_backprop_filter_akg(): | |||
| """Conv2DBackpropFilter AutoDiff register""" | |||
| return | |||
| @@ -1,88 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Conv2DBackpropInput op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Conv2DBackpropInput", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "CONVLUTION", | |||
| "attr": [ | |||
| { | |||
| "name": "input_sizes", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "filter_shape", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "stride", | |||
| "param_type": "optional", | |||
| "type": "int" | |||
| }, | |||
| { | |||
| "name": "pad_list", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "dilation", | |||
| "param_type": "optional", | |||
| "type": "int" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "out_backprop" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16" | |||
| ], | |||
| "format": [ | |||
| "FracZ" | |||
| ], | |||
| "name": "filter" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _conv2d_backprop_input_akg(): | |||
| """Conv2DBackpropInput AutoDiff register""" | |||
| return | |||
| @@ -1,108 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """ConvBN1 op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "ConvBN1", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "CONVLUTION", | |||
| "attr": [ | |||
| { | |||
| "name": "x_shape", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "w_shape", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "pad_list", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "stride", | |||
| "param_type": "optional", | |||
| "type": "int" | |||
| }, | |||
| { | |||
| "name": "dilation", | |||
| "param_type": "optional", | |||
| "type": "int" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16" | |||
| ], | |||
| "format": [ | |||
| "FracZ" | |||
| ], | |||
| "name": "w" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "conv_res_16" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "var_part" | |||
| }, | |||
| { | |||
| "index": 2, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "mean" | |||
| } | |||
| ] | |||
| }""") | |||
| def _conv_bn1_akg(): | |||
| """ConvBN1 AutoDiff register""" | |||
| return | |||
| @@ -1,64 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Div op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Div", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "y" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _div_akg(): | |||
| """Div AutoDiff register""" | |||
| return | |||
| @@ -1,64 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Equal op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Equal", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "y" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "bool", "bool", "bool", "bool", "bool", "bool" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _equal_akg(): | |||
| """Equal AutoDiff register""" | |||
| return | |||
| @@ -1,64 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """EqualCount op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "EqualCount", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "OPAQUE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat" | |||
| ], | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat" | |||
| ], | |||
| "name": "y" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _equal_count_akg(): | |||
| """EqualCount AutoDiff register""" | |||
| return | |||
| @@ -1,54 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """EquivFormat op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "EquivFormat", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "FRACTAL_NZ", "FRACTAL_NZ", "DefaultFormat", "DefaultFormat" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _equiv_format_akg(): | |||
| """EquivFormat AutoDiff register""" | |||
| return | |||
| @@ -1,59 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Exp op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Exp", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32", | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32", | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _exp_akg(): | |||
| """Exp AutoDiff register""" | |||
| return | |||
| @@ -1,58 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """ExpandDims op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "ExpandDims", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "OPAQUE", | |||
| "attr": [ | |||
| { | |||
| "name": "axis", | |||
| "param_type": "required", | |||
| "type": "int" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat" | |||
| ], | |||
| "name": "y" | |||
| } | |||
| ] | |||
| }""") | |||
| def _expand_dims_akg(): | |||
| """ExpandDims AutoDiff register""" | |||
| return | |||
| @@ -1,68 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Five2Four op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Five2Four", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "OPAQUE", | |||
| "attr": [ | |||
| { | |||
| "name": "shape4d", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "dstType", | |||
| "param_type": "required", | |||
| "type": "str" | |||
| }, | |||
| { | |||
| "name": "output_format", | |||
| "param_type": "required", | |||
| "type": "str" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16","float16","float16","float32","float16","float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0","NC1HWC0","NC1HWC0","NC1HWC0","NC1HWC0","NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16","float16","float32","float32","float32","float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat","NHWC","DefaultFormat","DefaultFormat","NHWC","NHWC" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _five2four_akg(): | |||
| """Five2Four AutoDiff register""" | |||
| return | |||
| @@ -1,64 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """FloorDiv op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "FloorDiv", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "y" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "int32", "int32", "int32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _floor_div_akg(): | |||
| """FloorDiv AutoDiff register""" | |||
| return | |||
| @@ -1,63 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Four2Five op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Four2Five", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "OPAQUE", | |||
| "attr": [ | |||
| { | |||
| "name": "data_format", | |||
| "param_type": "optional", | |||
| "type": "listStr" | |||
| }, | |||
| { | |||
| "name": "dst_type", | |||
| "param_type": "required", | |||
| "type": "str" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float32", "float16","float32", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NHWC", "NHWC", "NHWC" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float16", "float32", "float16", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0", "NC1HWC0", "NC1HWC0", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _four2five_akg(): | |||
| """Four2Five AutoDiff register""" | |||
| return | |||
| @@ -1,149 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """FusedBatchNorm op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "FusedBatchNorm", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "OPAQUE", | |||
| "attr": [ | |||
| { | |||
| "name": "momentum", | |||
| "param_type": "optional", | |||
| "type": "float" | |||
| }, | |||
| { | |||
| "name": "epsilon", | |||
| "param_type": "optional", | |||
| "type": "float" | |||
| }, | |||
| { | |||
| "name": "data_format", | |||
| "param_type": "optional", | |||
| "type": "listStr" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "scale" | |||
| }, | |||
| { | |||
| "index": 2, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "b" | |||
| }, | |||
| { | |||
| "index": 3, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "mean" | |||
| }, | |||
| { | |||
| "index": 4, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "variance" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "y" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "running_mean" | |||
| }, | |||
| { | |||
| "index": 2, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "running_variance" | |||
| }, | |||
| { | |||
| "index": 3, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "save_mean" | |||
| }, | |||
| { | |||
| "index": 4, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "save_inv_variance" | |||
| } | |||
| ] | |||
| }""") | |||
| def _fused_batch_norm_akg(): | |||
| """FusedBatchNorm AutoDiff register""" | |||
| return | |||
| @@ -1,119 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """FusedBatchNormGrad op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "FusedBatchNormGrad", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "OPAQUE", | |||
| "attr": [ | |||
| { | |||
| "name": "data_format", | |||
| "param_type": "optional", | |||
| "type": "listStr" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "dy" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 2, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "scale" | |||
| }, | |||
| { | |||
| "index": 3, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "save_mean" | |||
| }, | |||
| { | |||
| "index": 4, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "save_inv_variance" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "dx" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "bn_scale" | |||
| }, | |||
| { | |||
| "index": 2, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "bn_bias" | |||
| } | |||
| ] | |||
| }""") | |||
| def _fused_batch_norm_grad_akg(): | |||
| """BiasAddGrad AutoDiff register""" | |||
| return | |||
| @@ -1,109 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """FusedBatchNormInfer op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "FusedBatchNormInfer", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "OPAQUE", | |||
| "attr": [ | |||
| { | |||
| "name": "momentum", | |||
| "param_type": "optional", | |||
| "type": "float" | |||
| }, | |||
| { | |||
| "name": "epsilon", | |||
| "param_type": "optional", | |||
| "type": "float" | |||
| }, | |||
| { | |||
| "name": "data_format", | |||
| "param_type": "optional", | |||
| "type": "listStr" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "scale" | |||
| }, | |||
| { | |||
| "index": 2, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "b" | |||
| }, | |||
| { | |||
| "index": 3, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "mean" | |||
| }, | |||
| { | |||
| "index": 4, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "variance" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "y" | |||
| } | |||
| ] | |||
| }""") | |||
| def _fused_batch_norm_infer_akg(): | |||
| """FusedBatchNormInfer AutoDiff register""" | |||
| return | |||
| @@ -1,64 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """FusedBN1 op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "FusedBN1", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "COMMREDUCE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "data" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float32", "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float32", "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _fused_bn1_akg(): | |||
| """FusedBN1 AutoDiff register""" | |||
| return | |||
| @@ -1,93 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """BNGrad1 op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "BNGrad1", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "COMMREDUCE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "dy" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "data" | |||
| },{ | |||
| "index": 2, | |||
| "dtype": [ | |||
| "float32", "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "mean" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float32", "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float32", "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| }, | |||
| { | |||
| "index": 2, | |||
| "dtype": [ | |||
| "float32", "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _bn1_grad_akg(): | |||
| """BNGrad1 AutoDiff register""" | |||
| return | |||
| @@ -1,108 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """FusedBN2 op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "FusedBN2", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "COMMREDUCE", | |||
| "attr": [ | |||
| { | |||
| "name": "momentum", | |||
| "param_type": "optional", | |||
| "type": "float" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "mean" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "var_part" | |||
| }, | |||
| { | |||
| "index": 2, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "running_mean" | |||
| }, | |||
| { | |||
| "index": 3, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "running_var" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| }, | |||
| { | |||
| "index": 2, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _fused_bn2_akg(): | |||
| """FusedBN2 AutoDiff register""" | |||
| return | |||
| @@ -1,132 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """BNGrad1 op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "BNGrad2", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "COMMREDUCE", | |||
| "attr": [ | |||
| { | |||
| "name": "eps", | |||
| "param_type": "optional", | |||
| "type": "float" | |||
| }, | |||
| { | |||
| "name": "data_shape", | |||
| "param_type": "optional", | |||
| "type": "listInt" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "dgamma_red_hw" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "dbeta_red_hw" | |||
| },{ | |||
| "index": 2, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "variance" | |||
| }, | |||
| { | |||
| "index": 3, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "gamma" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| }, | |||
| { | |||
| "index": 2, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| }, | |||
| { | |||
| "index": 3, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| }, | |||
| { | |||
| "index": 4, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _bn2_grad_akg(): | |||
| """BNGrad2 AutoDiff register""" | |||
| return | |||
| @@ -1,95 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """FusedBN3 op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "FusedBN3", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| { | |||
| "name": "eps", | |||
| "param_type": "optional", | |||
| "type": "float" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "data" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "mean" | |||
| },{ | |||
| "index": 2, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "variance" | |||
| },{ | |||
| "index": 3, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "gamma" | |||
| },{ | |||
| "index": 4, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "beta" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _fused_bn3_akg(): | |||
| """FusedBN3 AutoDiff register""" | |||
| return | |||
| @@ -1,93 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """BNGrad3 op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "BNGrad3", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "dy" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float32", "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "rs" | |||
| },{ | |||
| "index": 2, | |||
| "dtype": [ | |||
| "float32", "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "dgamma_dx" | |||
| }, | |||
| { | |||
| "index": 3, | |||
| "dtype": [ | |||
| "float32", "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "dbeta_dx" | |||
| }, | |||
| { | |||
| "index": 4, | |||
| "dtype": [ | |||
| "float32", "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "data_minus_mean" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _bn3_grad_akg(): | |||
| """BNGrad3 AutoDiff register""" | |||
| return | |||
| @@ -1,68 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """GatherV2 op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "GatherV2", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| { | |||
| "name": "axis", | |||
| "param_type": "optional", | |||
| "type": "int" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat" | |||
| ], | |||
| "name": "params" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "int32", "int32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat" | |||
| ], | |||
| "name": "indices" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _gather_v2_akg(): | |||
| """GatherV2 AutoDiff register""" | |||
| return | |||
| @@ -1,64 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Greater op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Greater", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float16", "float32", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "NC1HWC0", "DefaultFormat", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16", "float16", "float32", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "NC1HWC0", "DefaultFormat", "NC1HWC0" | |||
| ], | |||
| "name": "y" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "bool", "bool", "bool", "bool" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "NC1HWC0", "DefaultFormat", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _greater_akg(): | |||
| """Greater AutoDiff register""" | |||
| return | |||
| @@ -1,64 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """GreaterEqual op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "GreaterEqual", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "y" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "bool", "bool", "bool", "bool", "bool", "bool" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _greater_equal_akg(): | |||
| """Equal AutoDiff register""" | |||
| return | |||
| @@ -1,78 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """InplaceAssign op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "InplaceAssign", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| { | |||
| "name": "fake_output", | |||
| "param_type": "optional", | |||
| "type": "bool" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "int32", "float16", "float32", "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0", "FracZ", "FracZ", "FracZ" | |||
| ], | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "int32", "float16", "float32", "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0", "FracZ", "FracZ", "FracZ" | |||
| ], | |||
| "name": "y" | |||
| }, | |||
| { | |||
| "index": 2, | |||
| "dtype": [ | |||
| "int32", "float16", "float32", "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0", "FracZ", "FracZ", "FracZ" | |||
| ], | |||
| "name": "z" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "int32", "float16", "float32", "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0", "FracZ", "FracZ", "FracZ" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _inplace_assign_akg(): | |||
| """InplaceAssign AutoDiff register""" | |||
| return | |||
| @@ -1,64 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Less op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Less", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float16" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16", "float16" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "NC1HWC0" | |||
| ], | |||
| "name": "y" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "bool", "bool" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _less_akg(): | |||
| """Less AutoDiff register""" | |||
| return | |||
| @@ -1,64 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """LessEqual op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "LessEqual", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "y" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "bool", "bool", "bool", "bool", "bool", "bool" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _less_equal_akg(): | |||
| """Equal AutoDiff register""" | |||
| return | |||
| @@ -1,55 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Log op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Log", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _log_akg(): | |||
| """Log AutoDiff register""" | |||
| return | |||
| @@ -1,73 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """MatMul op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "MatMul", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "OPAQUE", | |||
| "attr": [ | |||
| { | |||
| "name": "transpose_a", | |||
| "param_type": "optional", | |||
| "type": "bool" | |||
| }, | |||
| { | |||
| "name": "transpose_b", | |||
| "param_type": "optional", | |||
| "type": "bool" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat" | |||
| ], | |||
| "name": "x1" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat" | |||
| ], | |||
| "name": "x2" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _matmul_akg(): | |||
| """MatMul AutoDiff register""" | |||
| return | |||
| @@ -1,63 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Max op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Max", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "COMMREDUCE", | |||
| "attr": [ | |||
| { | |||
| "name": "axis", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "keep_dims", | |||
| "param_type": "required", | |||
| "type": "bool" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _max_akg(): | |||
| """Max AutoDiff register""" | |||
| return | |||
| @@ -1,93 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """MaxPoolGradWithArgmax op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "MaxPoolGradWithArgmax", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "CONVLUTION", | |||
| "attr": [ | |||
| { | |||
| "name": "pad_mode", | |||
| "param_type": "optional", | |||
| "type": "str" | |||
| }, | |||
| { | |||
| "name": "window", | |||
| "param_type": "optional", | |||
| "type": "int" | |||
| }, | |||
| { | |||
| "name": "pad", | |||
| "param_type": "optional", | |||
| "type": "int" | |||
| }, | |||
| { | |||
| "name": "stride", | |||
| "param_type": "optional", | |||
| "type": "int" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float16" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat" | |||
| ], | |||
| "name": "argmax" | |||
| }, | |||
| { | |||
| "index": 2, | |||
| "dtype": [ | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "grad" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _max_pool_grad_with_argmax_akg(): | |||
| """MaxPoolGradWithArgmax AutoDiff register""" | |||
| return | |||
| @@ -1,83 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """MaxPoolWithArgmax op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "MaxPoolWithArgmax", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "CONVLUTION", | |||
| "attr": [ | |||
| { | |||
| "name": "pad_mode", | |||
| "param_type": "optional", | |||
| "type": "str" | |||
| }, | |||
| { | |||
| "name": "window", | |||
| "param_type": "optional", | |||
| "type": "int" | |||
| }, | |||
| { | |||
| "name": "pad", | |||
| "param_type": "optional", | |||
| "type": "int" | |||
| }, | |||
| { | |||
| "name": "stride", | |||
| "param_type": "optional", | |||
| "type": "int" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16" | |||
| ], | |||
| "format": [ | |||
| "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat" | |||
| ], | |||
| "name": "argmax" | |||
| } | |||
| ] | |||
| }""") | |||
| def _max_pool_with_argmax_akg(): | |||
| """MaxPoolWithArgmax AutoDiff register""" | |||
| return | |||
| @@ -1,64 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Maximum op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Maximum", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "COMMREDUCE", | |||
| "attr": [], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "y" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _maximum_akg(): | |||
| """Maximum AutoDiff register""" | |||
| return | |||
| @@ -1,54 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """SimpleMean op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "SimpleMean", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "COMMREDUCE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _mean_akg(): | |||
| """SimpleMean AutoDiff register""" | |||
| return | |||
| @@ -1,58 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """SimpleMeanGrad op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "SimpleMeanGrad", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "COMMREDUCE", | |||
| "attr": [ | |||
| { | |||
| "name": "input_shape", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "HEAD" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _mean_grad_akg(): | |||
| """SimpleMeanGrad AutoDiff register""" | |||
| return | |||
| @@ -1,70 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Minimum op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Minimum", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "COMMREDUCE", | |||
| "attr": [], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32", | |||
| "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32", | |||
| "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "y" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32", | |||
| "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _minimum_akg(): | |||
| """Minimum AutoDiff register""" | |||
| return | |||
| @@ -1,86 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Mul op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Mul", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| { | |||
| "name": "x_shape", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "y_shape", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "data_format", | |||
| "param_type": "required", | |||
| "type": "listStr" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32", "float16", "float32", | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "FracZ", "FracZ", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32", "float16", "float32", | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "FracZ", "FracZ", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "y" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32", "float16", "float32", | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "FracZ", "FracZ", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _mul_akg(): | |||
| """Mul AutoDiff register""" | |||
| return | |||
| @@ -1,59 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Neg op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Neg", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32", | |||
| "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32", | |||
| "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _neg_akg(): | |||
| """Neg AutoDiff register""" | |||
| return | |||
| @@ -1,83 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """OneHot op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "OneHot", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "OPAQUE", | |||
| "attr": [ | |||
| { | |||
| "name": "depth", | |||
| "param_type": "required", | |||
| "type": "int" | |||
| }, | |||
| { | |||
| "name": "axis", | |||
| "param_type": "required", | |||
| "type": "int" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "int32", "int32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat" | |||
| ], | |||
| "name": "indices" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "int32", "float32", "float16" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat" | |||
| ], | |||
| "name": "on_value" | |||
| }, | |||
| { | |||
| "index": 2, | |||
| "dtype": [ | |||
| "int32", "float32", "float16" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat" | |||
| ], | |||
| "name": "off_value" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "int32", "float32", "float16" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _one_hot_akg(): | |||
| """OneHot AutoDiff register""" | |||
| return | |||
| @@ -1,65 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Pow op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Pow", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "int32", "float16", "int32", "float32", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "DefaultFormat", "NC1HWC0" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16", "int32", "float16", "int32", "float32", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "DefaultFormat", "NC1HWC0" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "power" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "int32", "float16", "int32", "float32", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "DefaultFormat", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _power_akg(): | |||
| """Pow AutoDiff register""" | |||
| return | |||
| @@ -1,72 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """RealDiv op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "RealDiv", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32", | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32", | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "y" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32", | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _real_div_akg(): | |||
| """RealDiv AutoDiff register""" | |||
| return | |||
| @@ -1,54 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Reciprocal op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Reciprocal", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _reciprocal_akg(): | |||
| """Reciprocal AutoDiff register""" | |||
| return | |||
| @@ -1,63 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """ReduceMax op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "ReduceMax", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "COMMREDUCE", | |||
| "attr": [ | |||
| { | |||
| "name": "axis", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "keep_dims", | |||
| "param_type": "required", | |||
| "type": "bool" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float16" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float16" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _reduce_max_akg(): | |||
| """ReduceMax AutoDiff register""" | |||
| return | |||
| @@ -1,63 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """ReduceMean op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "ReduceMean", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "COMMREDUCE", | |||
| "attr": [ | |||
| { | |||
| "name": "axis", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "keep_dims", | |||
| "param_type": "required", | |||
| "type": "bool" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _reduce_mean_akg(): | |||
| """ReduceMean AutoDiff register""" | |||
| return | |||
| @@ -1,73 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """ReduceSum op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "ReduceSum", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "COMMREDUCE", | |||
| "attr": [ | |||
| { | |||
| "name": "axis", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "keep_dims", | |||
| "param_type": "required", | |||
| "type": "bool" | |||
| }, | |||
| { | |||
| "name": "atomic_add", | |||
| "param_type": "optional", | |||
| "type": "str" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32", | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32", | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _reduce_sum_akg(): | |||
| """ReduceSum AutoDiff register""" | |||
| return | |||
| @@ -1,54 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """ReLU op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "ReLU", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _relu_akg(): | |||
| """ReLU AutoDiff register""" | |||
| return | |||
| @@ -1,64 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """ReluGrad op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "ReluGrad", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0" | |||
| ], | |||
| "name": "y_backprop" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16", "float32", "float16" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _relu_grad_akg(): | |||
| """ReluGrad AutoDiff register""" | |||
| return | |||
| @@ -1,58 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Reshape op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Reshape", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "OPAQUE", | |||
| "attr": [ | |||
| { | |||
| "name": "shape", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "tensor" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _reshape_akg(): | |||
| """Reshape AutoDiff register""" | |||
| return | |||
| @@ -1,54 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Round op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Round", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _round_akg(): | |||
| """Round AutoDiff register""" | |||
| return | |||
| @@ -1,54 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Rsqrt op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Rsqrt", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _rsqrt_akg(): | |||
| """Rsqrt AutoDiff register""" | |||
| return | |||
| @@ -1,76 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Select op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Select", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "bool", "bool", "bool", "bool", "bool", "bool" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "DefaultFormat", "NC1HWC0" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "condition" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "float16", "int32", "float16", "int32", "float32", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "DefaultFormat", "NC1HWC0" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 2, | |||
| "dtype": [ | |||
| "float16", "int32", "float16", "int32", "float32", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "DefaultFormat", "NC1HWC0" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "y" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "int32", "float16", "int32", "float32", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "DefaultFormat", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _select_akg(): | |||
| """Select AutoDiff register""" | |||
| return | |||
| @@ -1,58 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Softmax op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Softmax", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| { | |||
| "name": "axis", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _softmax_akg(): | |||
| """Softmax AutoDiff register""" | |||
| return | |||
| @@ -1,73 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """SparseSoftmaxCrossEntropyWithLogits op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "SparseSoftmaxCrossEntropyWithLogits", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "OPAQUE", | |||
| "attr": [ | |||
| { | |||
| "name": "is_grad", | |||
| "param_type": "optional", | |||
| "type": "bool" | |||
| }, | |||
| { | |||
| "name": "sens", | |||
| "param_type": "optional", | |||
| "type": "float" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat" | |||
| ], | |||
| "name": "features" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat" | |||
| ], | |||
| "name": "labels" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _sparse_softmax_cross_entropy_with_logits_akg(): | |||
| """SparseSoftmaxCrossEntropyWithLogits AutoDiff register""" | |||
| return | |||
| @@ -1,54 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Sqrt op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Sqrt", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _sqrt_akg(): | |||
| """Sqrt AutoDiff register""" | |||
| return | |||
| @@ -1,93 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """StridedSlice op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "StridedSlice", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "OPAQUE", | |||
| "attr": [ | |||
| { | |||
| "name": "begin", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "end", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "strides", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "begin_mask", | |||
| "param_type": "required", | |||
| "type": "int" | |||
| }, | |||
| { | |||
| "name": "end_mask", | |||
| "param_type": "required", | |||
| "type": "int" | |||
| }, | |||
| { | |||
| "name": "ellipsis_mask", | |||
| "param_type": "required", | |||
| "type": "int" | |||
| }, | |||
| { | |||
| "name": "new_axis_mask", | |||
| "param_type": "required", | |||
| "type": "int" | |||
| }, | |||
| { | |||
| "name": "shrink_axis_mask", | |||
| "param_type": "required", | |||
| "type": "int" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _strided_slice_akg(): | |||
| """StridedSlice AutoDiff register""" | |||
| return | |||
| @@ -1,72 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Sub op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Sub", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "int32", "float16", "float32", "int32", "float16", "float32", | |||
| "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0", | |||
| "FracZ", "FracZ", "FracZ", "FRACTAL_NZ", "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "x" | |||
| }, | |||
| { | |||
| "index": 1, | |||
| "dtype": [ | |||
| "int32", "float16", "float32", "int32", "float16", "float32", | |||
| "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0", | |||
| "FracZ", "FracZ", "FracZ", "FRACTAL_NZ", "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "y" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "int32", "float16", "float32", "int32", "float16", "float32", | |||
| "int32", "float16", "float32", "int32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0", | |||
| "FracZ", "FracZ", "FracZ", "FRACTAL_NZ", "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _sub_akg(): | |||
| """Sub AutoDiff register""" | |||
| return | |||
| @@ -1,68 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Sum op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Sum", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "COMMREDUCE", | |||
| "attr": [ | |||
| { | |||
| "name": "axis", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| }, | |||
| { | |||
| "name": "keepdims", | |||
| "param_type": "required", | |||
| "type": "bool" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32", | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "param_type": "required", | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32", | |||
| "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", | |||
| "FRACTAL_NZ", "FRACTAL_NZ" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _sum_akg(): | |||
| """Sum AutoDiff register""" | |||
| return | |||
| @@ -1,58 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """Tile op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "Tile", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "OPAQUE", | |||
| "attr": [ | |||
| { | |||
| "name": "multiples", | |||
| "param_type": "required", | |||
| "type": "listInt" | |||
| } | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "int32", "float16", "float32", "int32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _tile_akg(): | |||
| """Tile AutoDiff register""" | |||
| return | |||
| @@ -1,54 +0,0 @@ | |||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| # ============================================================================ | |||
| """ZerosLike op""" | |||
| from mindspore.ops.op_info_register import op_info_register | |||
| @op_info_register("""{ | |||
| "op_name": "ZerosLike", | |||
| "imply_type": "AutoDiff", | |||
| "fusion_type": "ELEMWISE", | |||
| "attr": [ | |||
| ], | |||
| "inputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "x" | |||
| } | |||
| ], | |||
| "outputs": [ | |||
| { | |||
| "index": 0, | |||
| "dtype": [ | |||
| "float16", "float32", "float16", "float32" | |||
| ], | |||
| "format": [ | |||
| "DefaultFormat", "DefaultFormat", "NC1HWC0", "NC1HWC0" | |||
| ], | |||
| "name": "output" | |||
| } | |||
| ] | |||
| }""") | |||
| def _zeros_like_akg(): | |||
| """ZerosLike AutoDiff register""" | |||
| return | |||