1/* 2 * Copyright (c) 2023 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.v2_0; 17 18import ohos.hdi.nnrt.v2_0.NnrtTypes; 19 20struct Tensor { 21 String name; 22 enum DataType dataType; 23 int[] dims; 24 enum Format format; 25 struct SharedBuffer data; 26 struct QuantParam[] quantParams; 27}; 28 29struct Node { 30 String name; 31 enum NodeType nodeType; 32 byte[] nodeAttr; 33 unsigned int[] inputIndex; 34 unsigned int[] outputIndex; 35 enum QuantType quantType; 36}; 37 38struct SubGraph { 39 String name; 40 unsigned int[] inputIndices; 41 unsigned int[] outputIndices; 42 unsigned int[] nodeIndices; 43}; 44 45struct Model { 46 String name; 47 unsigned int[] inputIndex; 48 unsigned int[] outputIndex; 49 struct Node[] nodes; 50 struct Tensor[] allTensors; 51 struct SubGraph[] subGraph; 52};