1 /** 2 * Copyright 2020-2022 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_UTILS_FLAGS_H 18 #define MINDSPORE_CORE_UTILS_FLAGS_H 19 20 namespace mindspore { 21 // flag names 22 inline const char GRAPH_FLAG_MIX_PRECISION_FP16[] = "fp16"; 23 inline const char GRAPH_FLAG_MIX_PRECISION_FP32[] = "fp32"; 24 inline const char GRAPH_FLAG_MIX_PRECISION_BF16[] = "bf16"; 25 inline const char GRAPH_FLAG_CACHE_ENABLE[] = "cache_enable"; 26 inline const char GRAPH_FLAG_SIDE_EFFECT_IO[] = "side_effect_io"; 27 inline const char GRAPH_FLAG_SIDE_EFFECT_MEM[] = "side_effect_mem"; 28 inline const char GRAPH_FLAG_SIDE_EFFECT_HIDDEN[] = "side_effect_hidden"; 29 inline const char GRAPH_FLAG_SIDE_EFFECT_EXCEPTION[] = "side_effect_exception"; 30 inline const char GRAPH_FLAG_SIDE_EFFECT_PROPAGATE[] = "side_effect_propagate"; 31 inline const char GRAPH_FLAG_SIDE_EFFECT_BACKPROP[] = "side_effect_backprop"; 32 inline const char GRAPH_FLAG_SIDE_EFFECT_BACKPROP_MEM[] = "side_effect_backprop_mem"; 33 inline const char GRAPH_FLAG_FORBID_REUSE_RESULT[] = "forbid_reuse_result"; 34 inline const char GRAPH_FLAG_CONSTEXPR_PRIM[] = "constexpr_prim"; 35 inline const char GRAPH_FLAG_IS_WHILE_HEADER[] = "is_while_header"; 36 inline const char GRAPH_FLAG_ORDER_ENFORCE_SKIP[] = "order_enforce_skip"; 37 inline const char GRAPH_FLAG_BPROP_RETURN_SPARSE[] = "bprop_return_sparse"; 38 39 // method names of python primitive called from c++ source code 40 // 1. infer method name of class 'PrimitiveWithInfer' 41 inline const char PY_PRIM_METHOD_INFER[] = "__infer__"; 42 // 2. check method name of class 'PrimitiveWithCheck' 43 inline const char PY_PRIM_METHOD_CHECK[] = "__check__"; 44 // 3. method name of class 'PrimitivePy' for constant propagation 45 inline const char PY_PRIM_METHOD_INFER_VALUE[] = "infer_value"; 46 47 // type inference related attributes 48 inline const char ATTR_VALUE[] = "value"; 49 inline const char ATTR_DTYPE[] = "dtype"; 50 inline const char ATTR_SHAPE[] = "shape"; 51 inline const char ATTR_NO_ELIMINATE[] = "no_eliminate"; 52 } // namespace mindspore 53 54 #endif // MINDSPORE_CORE_UTILS_FLAGS_H 55