1 /** 2 * This is the C++ adaptation and derivative work of Myia (https://github.com/mila-iqia/myia/). 3 * 4 * Copyright 2023 Huawei Technologies Co., Ltd 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 #ifndef MINDSPORE_CCSRC_PIPELINE_JIT_STATIC_ANALYSIS_BUILTIN_PRIM_H_ 20 #define MINDSPORE_CCSRC_PIPELINE_JIT_STATIC_ANALYSIS_BUILTIN_PRIM_H_ 21 22 #include <memory> 23 #include <string> 24 25 #include "utils/hash_map.h" 26 #include "pipeline/jit/ps/static_analysis/evaluator.h" 27 #include "abstract/ops/primitive_infer_map.h" 28 29 namespace mindspore { 30 namespace abstract { 31 class InnerAbsEvaluator : public TransitionPrimEvaluator { 32 public: InnerAbsEvaluator()33 InnerAbsEvaluator() : TransitionPrimEvaluator("InnerAbsEvaluator") {} 34 ~InnerAbsEvaluator() override = default; 35 MS_DECLARE_PARENT(InnerAbsEvaluator, TransitionPrimEvaluator); 36 EvalResultPtr EvalPrim(const AnalysisEnginePtr &engine, const AbstractBasePtrList &args_abs_list, const ConfigPtr &, 37 const AnfNodeConfigPtr &out_conf) override; 38 bool CheckConst(const AbstractBasePtrList &args_abs_list) const; 39 }; 40 41 class InnerRoundEvaluator : public TransitionPrimEvaluator { 42 public: InnerRoundEvaluator()43 InnerRoundEvaluator() : TransitionPrimEvaluator("InnerRoundEvaluator") {} 44 ~InnerRoundEvaluator() override = default; 45 MS_DECLARE_PARENT(InnerRoundEvaluator, TransitionPrimEvaluator); 46 EvalResultPtr EvalPrim(const AnalysisEnginePtr &engine, const AbstractBasePtrList &args_abs_list, const ConfigPtr &, 47 const AnfNodeConfigPtr &out_conf) override; 48 bool CheckConst(const AbstractBasePtrList &args_abs_list) const; 49 }; 50 } // namespace abstract 51 } // namespace mindspore 52 53 #endif // MINDSPORE_CCSRC_PIPELINE_JIT_STATIC_ANALYSIS_BUILTIN_PRIM_H_ 54