1 /** 2 * Copyright 2023 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_OP_ENUM_H_ 18 #define MINDSPORE_CORE_OPS_OP_ENUM_H_ 19 #include <string> 20 #include <vector> 21 #include <memory> 22 #include <unordered_map> 23 24 #include "mindapi/base/macros.h" 25 26 namespace mindspore { 27 namespace ops { 28 MIND_API int64_t StringToEnumImpl(const std::string &op_name, const std::string &arg_name, 29 const std::string &enum_string); 30 31 // Only the current mindspore/core/mindapi/base/types.h and other files do not have 32 // corresponding enumerations and then add new enumerations. 33 // The `enum` is used here instead of `enum class` because the current backend enum is 34 // represented by `int`. The `enum` is more convenient than `enum class` compare with int. 35 enum Direction : int64_t { UNIDIRECTIONAL = 0 }; 36 37 enum CellType : int64_t { CELL_TYPE_LSTM = 0 }; 38 39 enum Group : int64_t { SYNC_BN_GROUP0 = 0 }; 40 41 enum InterpolationMode : int64_t { BILINEAR = 0, NEAREST = 1 }; 42 43 enum RoundingMode : int64_t { ROUND = 0, TRUNC = 1, FLOOR = 2, CEIL = 3 }; 44 45 enum NormMode : int64_t { BACKWARD = 0, FORWARD = 1, ORTHO = 2 }; 46 47 enum GridSamplerPaddingMode : int64_t { ZEROS = 0, BORDER = 1, REFLECTION = 2 }; 48 49 enum KVCacheAlignMode : int64_t { RIGHT = 0, LEFT = 1 }; 50 51 enum FASInputLayoutMode : int64_t { BSH = 0, BNSD = 1, SBH = 2, BSND = 3, TND = 4 }; 52 } // namespace ops 53 } // namespace mindspore 54 #endif // MINDSPORE_CORE_OPS_ENUM_H_ 55