1/* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16package ohos.hdi.nnrt.v1_0; 17 18import ohos.hdi.nnrt.v1_0.NnrtTypes; 19 20struct Activation 21{ 22 enum ActivationType activationType; 23 float alpha; 24 float minVal; 25 float maxVal; 26 boolean approximate; 27}; 28 29struct AddFusion 30{ 31 enum ActivationType activationType; 32}; 33 34struct ArgMaxFusion 35{ 36 long axis; 37 long topK; 38 boolean keepDims; 39 boolean outMaxValue; 40}; 41 42struct AvgPoolFusion 43{ 44 long[] kernelSize; 45 long[] strides; 46 long[] pad; 47 enum PadMode padMode; 48 enum RoundMode roundMode; 49 enum Format format; 50 boolean global; 51 enum ActivationType activationType; 52}; 53 54struct BatchToSpaceND 55{ 56 long[] blockShape; 57 long[][] crops; 58}; 59 60struct BiasAdd 61{ 62}; 63 64struct Cast 65{ 66}; 67 68struct Concat 69{ 70 long axis; 71}; 72 73struct Conv2DFusion 74{ 75 long[] kernelSize; 76 long[] stride; 77 long[] dilation; 78 enum PadMode padMode; 79 long[] padList; 80 long group; 81 long inChannel; 82 long outChannel; 83 enum ActivationType activationType; 84}; 85 86struct Conv2dTransposeFusion 87{ 88 long[] kernelSize; 89 long[] stride; 90 long[] dilation; 91 enum PadMode padMode; 92 long[] padList; 93 long group; 94 long inChannel; 95 long outChannel; 96 enum ActivationType activationType; 97 long[] outputPaddings; 98}; 99 100struct DivFusion 101{ 102 enum ActivationType activationType; 103}; 104 105struct Eltwise 106{ 107 enum EltwiseMode mode; 108}; 109 110struct ExpandDims 111{ 112}; 113 114struct Fill 115{ 116}; 117 118struct FullConnection 119{ 120 boolean hasBias; 121 boolean useAxis; 122 long axis; 123 enum ActivationType activationType; 124}; 125 126struct FusedBatchNorm 127{ 128 float epsilon; 129}; 130 131struct Gather 132{ 133}; 134 135struct LayerNormFusion 136{ 137 long beginNormAxis; 138 float epsilon; 139 boolean elementwiseAffine; 140 long beginParamsAxis; 141}; 142 143struct LessEqual 144{ 145}; 146 147struct MatMulFusion 148{ 149 boolean transposeA; 150 boolean transposeB; 151 enum ActivationType activationType; 152}; 153 154struct Maximum 155{ 156}; 157 158struct MaxPoolFusion 159{ 160 long[] kernelSize; 161 long[] strides; 162 long[] pad; 163 enum PadMode padMode; 164 enum Format format; 165 boolean global; 166 enum ActivationType activationType; 167}; 168 169struct MulFusion 170{ 171 enum ActivationType activationType; 172}; 173 174struct OneHot 175{ 176 long axis; 177}; 178 179struct PadFusion 180{ 181 long[][] paddings; 182 enum PaddingMode paddingMode; 183 float constantValue; 184}; 185 186struct PowFusion 187{ 188 float scale; 189 float shift; 190}; 191 192struct PReLUFusion 193{ 194 boolean channelShared; 195}; 196 197struct QuantDTypeCast 198{ 199 long srcT; 200 long dstT; 201}; 202 203struct ReduceFusion 204{ 205 boolean keepDims; 206 enum ReduceMode mode; 207 boolean reduceToEnd; 208 float coeff; 209}; 210 211struct Reshape 212{ 213}; 214 215struct Resize 216{ 217 enum ResizeMethod method; 218 long newHeight; 219 long newWidth; 220 boolean preserveAspectRatio; 221 enum CoordinateTransformMode coordinateTransformMode; 222 float cubicCoeff; 223 long excludeOutside; 224 float extrapolationValue; 225 enum NearestMode nearestMode; 226}; 227 228struct Rsqrt 229{ 230}; 231 232struct ScaleFusion 233{ 234 long axis; 235 enum ActivationType activationType; 236}; 237 238struct Shape 239{ 240}; 241 242struct SliceFusion 243{ 244 long[] axes; 245}; 246 247struct Softmax 248{ 249 long[] axis; 250}; 251 252struct SpaceToBatchND 253{ 254 long[] blockShape; 255 long[][] paddings; 256}; 257 258struct Split 259{ 260 long outputNum; 261 long[] sizeSplits; 262 long axis; 263}; 264 265struct Sqrt 266{ 267}; 268 269struct SquaredDifference 270{ 271}; 272 273struct Squeeze 274{ 275 long[] axis; 276}; 277 278struct Stack 279{ 280 long axis; 281}; 282 283struct StridedSlice 284{ 285 long beginMask; 286 long endMask; 287 long ellipsisMask; 288 long newAxisMask; 289 long shrinkAxisMask; 290}; 291 292struct SubFusion 293{ 294 enum ActivationType activationType; 295}; 296 297struct TileFusion 298{ 299 long[] dims; 300}; 301 302struct TopKFusion 303{ 304 boolean sorted; 305 long axis; 306}; 307 308struct Transpose 309{ 310}; 311 312struct Unsqueeze 313{ 314 long[] axis; 315};