1 /** 2 * Copyright 2021 Huawei Technologies Co., Ltd 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef MINDSPORE_CORE_OPS_FUSION_MAT_MUL_FUSION_H_ 18 #define MINDSPORE_CORE_OPS_FUSION_MAT_MUL_FUSION_H_ 19 #include <memory> 20 #include "ops/base_operator.h" 21 #include "mindapi/base/types.h" 22 23 namespace mindspore { 24 namespace ops { 25 constexpr auto kNameMatMulFusion = "MatMulFusion"; 26 /// \brief Multiplies matrix a and matrix b. Refer to Python API @ref mindspore.ops.MatMul for more details. 27 class MIND_API MatMulFusion : public BaseOperator { 28 public: 29 MIND_API_BASE_MEMBER(MatMulFusion); 30 /// \brief Constructor. MatMulFusion()31 MatMulFusion() : BaseOperator(kNameMatMulFusion) {} 32 /// \brief Init. Refer to the parameters of Python API @ref mindspore.ops.MatMulFusion for the inputs. 33 void Init(bool transpose_a = false, bool transpose_b = false, const ActivationType &activation_type = NO_ACTIVATION); 34 /// \brief Method to set activation type. 35 /// 36 /// \param[in] activation_type Define the activation type. 37 void set_activation_type(const ActivationType activation_type); 38 /// \brief Method to get activation type. 39 /// 40 /// \return activation type. 41 ActivationType get_activation_type() const; 42 /// \brief Set transpose_a. 43 void set_transpose_a(bool transpose_a); 44 /// \brief Set transpose_b. 45 void set_transpose_b(bool transpose_b); 46 /// \brief Get transpose_a. 47 /// 48 /// \return transpose_a. 49 bool get_transpose_a() const; 50 /// \brief Get transpose_b. 51 /// 52 /// \return transpose_b. 53 bool get_transpose_b() const; 54 }; 55 } // namespace ops 56 } // namespace mindspore 57 #endif // MINDSPORE_CORE_OPS_FUSION_MAT_MUL_FUSION_H_ 58