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_MINDAPI_BASE_TYPES_H_ 18 #define MINDSPORE_CORE_MINDAPI_BASE_TYPES_H_ 19 20 #include <cstdint> 21 22 namespace mindspore { 23 enum CoordinateTransformMode : int64_t { 24 ASYMMETRIC = 0, 25 ALIGN_CORNERS = 1, 26 HALF_PIXEL = 2, 27 CROP_AND_RESIZE = 3, 28 }; 29 30 enum class ResizeMethod : int64_t { 31 UNKNOWN = -1, 32 LINEAR = 0, 33 NEAREST = 1, 34 CUBIC = 2, 35 AREA = 3, 36 }; 37 38 enum class NearestMode : int64_t { 39 NORMAL = 0, 40 ROUND_HALF_DOWN = 1, 41 ROUND_HALF_UP = 2, 42 FLOOR = 3, 43 CEIL = 4, 44 }; 45 46 enum RoundMode : int64_t { 47 FLOOR = 0, 48 CEIL = 1, 49 }; 50 51 enum ActivationType : int64_t { 52 NO_ACTIVATION = 0, 53 RELU = 1, 54 SIGMOID = 2, 55 RELU6 = 3, 56 ELU = 4, 57 LEAKY_RELU = 5, 58 ABS = 6, 59 RELU1 = 7, 60 SOFTSIGN = 8, 61 SOFTPLUS = 9, 62 TANH = 10, 63 SELU = 11, 64 HSWISH = 12, 65 HSIGMOID = 13, 66 THRESHOLDRELU = 14, 67 LINEAR = 15, 68 HARD_TANH = 16, 69 SIGN = 17, 70 SWISH = 18, 71 GELU = 19, 72 GLU = 20, 73 UNKNOWN = 21, 74 FASTGELU = 22, 75 SILU = 23, 76 GEGLU = 24, 77 SWIGLU = 25, 78 REGLU = 26, 79 }; 80 81 enum ReduceMode : int64_t { 82 Reduce_Mean = 0, 83 Reduce_Max = 1, 84 Reduce_Min = 2, 85 Reduce_Prod = 3, 86 Reduce_Sum = 4, 87 Reduce_Sum_Square = 5, 88 Reduce_ASum = 6, 89 Reduce_All = 7, 90 Reduce_L2 = 8, 91 Reduce_L1 = 9, 92 Reduce_Log_Sum = 10, 93 Reduce_Log_Sum_Exp = 11 94 }; 95 96 enum EltwiseMode : int64_t { 97 PROD = 0, 98 SUM = 1, 99 MAXIMUM = 2, 100 ELTWISEMODE_UNKNOW = 3, 101 }; 102 103 enum Reduction : int64_t { 104 REDUCTION_SUM = 0, 105 MEAN = 1, 106 NONE = 2, 107 UPDATE = 3, 108 }; 109 110 enum PadMode : int64_t { 111 PAD = 0, 112 SAME = 1, 113 VALID = 2, 114 FULL = 3, 115 }; 116 117 enum class LshProjectionType : int64_t { 118 UNKNOWN = 0, 119 SPARSE = 1, 120 DENSE = 2, 121 }; 122 123 enum PaddingMode : int64_t { 124 CONSTANT = 0, 125 REFLECT = 1, 126 SYMMETRIC = 2, 127 MODE_RESERVED = 3, 128 }; 129 130 enum PoolMode : int64_t { 131 MAX_POOLING = 0, 132 MEAN_POOLING = 1, 133 }; 134 135 enum NormMode : int64_t { BACKWARD = 0, FORWARD = 1, ORTHO = 2 }; 136 137 // float is a float64 in python. But for some historical reason, python float is converted to float32 in 138 using pyfloat = float; 139 using pyint = int32_t; 140 } // namespace mindspore 141 #endif // MINDSPORE_CORE_MINDAPI_BASE_TYPES_H_ 142